// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\store\model; use app\common\enum\order\OrderStatus as OrderStatusEnum; use app\common\model\OrderGoods as OrderGoodsModel; /** * 订单商品模型 * Class OrderGoods * @package app\store\model */ class OrderGoods extends OrderGoodsModel { /** * 修改订单状态 * @param $where * @param $field * @return false|int */ public static function orderUpdate($where, $field) { return (new static())->where($where)->update($field) !== false; } /** * 撤销分油,回收 * @param array $data * @return bool */ public function cancelShare(array $data): bool { // 更新订单记录 return $this->save([ 'order_status' => 20 ]) !== false; } }