feat : coupon
This commit is contained in:
@@ -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
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user