255], [['randomstr'], 'string', 'max' => 32], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'mall_id' => '商城ID', 'type' => '类型', 'out_trade_no' => '订单号', 'oldtrxid' => '原交易的收银宝平台流水', 'trade_type' => 'trade_type', 'randomstr' => '随机字符', 'request_data' => '请求数据', 'response_data' => '返回数据', 'status' => '状态', 'updated_at' => 'Updated At', 'created_at' => 'Created At', ]; } public static function setData(int $mall_id, array $data) { $model = new self(); $model->loadDefaultValues(); $model->mall_id = $mall_id; if (!$model->load($data, '')) throw new \Exception($model->getErrorMessage()); if (!$model->save()) { Yii::error(';;;;;;;;;;;;;;'.$model->getErrorMessage()); return false; } return $model; } }