100], [['cover', 'consumer_name','from_type'], 'string', 'max' => 255], [['consumer_type'], 'string', 'max' => 20], [['source_table'], 'string', 'max' => 200], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => '订单id', 'order_id' => '订单id', 'order_no' => '订单编号', 'out_trade_no' => '系统支付流水号', 'title' => '订单标题', 'cover' => '订单封面', 'consumer_id' => '消费者ID', 'consumer_name' => '消费者名称', 'consumer_type' => '消费者类型[mall=商城,agent=代理商]', 'pay_money' => '订单实付金额,单位:元', 'order_price' => '订单价格,单位:元', 'order_status' => '订单状态', 'payment_type' => '支付方式[1=微信,2=支付宝]', 'pay_status' => '订单付款状态[0=未支付,1=已支付]', 'pay_time' => '订单付款时间', 'expire_time' => '订单过期时间', 'source_table' => '来源表', 'settlement_status' => '结算状态[0=待结算,1=已结算]', 'extra_info' => '额外信息', 'status' => '状态[-1:删除;0:禁用;1启用]', 'created_at' => '创建时间', 'updated_at' => '更新时间', 'from_type' => '来源类型', ]; } /** * 保存数据 * @Author: lun * @DateTime: 2022/3/3 0003 17:24 * @Copyright: copyright (c) 2021 广东七件事集团 * @param $params * @return bool|PlatformOrder */ public static function setData($params) { try { if (!empty($params['id'])) { $model = self::findOne(['id' => $params['id']]); } else { $model = new self(); $model->loadDefaultValues(); } if (empty($model)) throw new Exception('查无此订单'); if (!$model->load($params, '') || !$model->save()) throw new Exception($model->getErrorMessage()); return $model; } catch (\Exception $e) { self::setStaticError($e->getMessage()); return false; } } }