feat : catering
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use App\Constants\Common\OrderCode;
|
||||
use Hyperf\Database\Concerns\BuildsQueries;
|
||||
use Hyperf\Database\Model\Builder;
|
||||
use Hyperf\Database\Model\Collection;
|
||||
@@ -74,4 +75,15 @@ class Order extends Model
|
||||
{
|
||||
return $this->where('order_sno',$orderSno)->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $orderIds
|
||||
* @return int
|
||||
*/
|
||||
public function isCateringByOrderIds(array $orderIds): int
|
||||
{
|
||||
return $this->whereIn('id', $orderIds)->update([
|
||||
'status' => OrderCode::PLAN
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
33
app/Model/PickupCode.php
Normal file
33
app/Model/PickupCode.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
use Hyperf\DbConnection\Model\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $order_id
|
||||
* @property int $copies
|
||||
* @property string $pickup_code
|
||||
* @property string $heapsort
|
||||
* @property string $create_time
|
||||
*/
|
||||
class PickupCode extends Model
|
||||
{
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'pickup_code';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*/
|
||||
protected array $casts = ['id' => 'integer', 'order_id' => 'integer', 'copies' => 'integer'];
|
||||
}
|
||||
Reference in New Issue
Block a user