hasOne(Sku::class, 'id', 'sku_id'); } /** * 设为已付款 * * @param string $orderCoding * @return bool */ public static function setPaid(string $orderCoding): bool { return self::where('coding', $orderCoding)->save([ 'is_paid' => self::COMMON_ON, 'paid_at' => date('Y-m-d H:i:s') ]); } /** * 订单相关信息取消(软删除) * * @param string $orderCoding * @return bool */ public static function cancel(string $orderCoding): bool { return self::where('coding', $orderCoding)->save([ 'status' => self::STATUS_CLOSED, 'deleted_at' => date('Y-m-d H:i:s') ]); } public static function history(array $where, array $field = []) { return self::where($where)->field($field)->select(); } }