feat : coupon

This commit is contained in:
2025-03-21 16:15:28 +08:00
parent 11a36ece80
commit 8a4674b1dc
11 changed files with 190 additions and 11 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Model;
use App\Constants\Common\OrderCode;
use Hyperf\DbConnection\Model\Model;
/**
@@ -52,4 +53,15 @@ class OrderGood extends Model
{
return $this->where('order_id', $orderId)->select('sku_id')->selectRaw('SUM(`quantity`) as `quantity`')->groupBy('sku_id')->get()->toArray();
}
/**
* @param array $orderIds
* @return int
*/
public function isCateringByOrderIds(array $orderIds): int
{
return $this->whereIn('order_id', $orderIds)->update([
'status' => OrderCode::PLAN
]);
}
}