'ID', 'goods_id' => 'Goods ID', 'store_id' => 'Store ID', 'order_status' => 'Order Status', 'status' => 'Status', 'total_num' => 'Total Num', 'total_price' => 'Total Price', 'created_at' => 'Created At', 'updated_at' => 'Updated At', 'agent_user' => 'Agent User', 'give_store_id' => 'Give Store ID', 'mall_id' => 'Mall ID', 'label_id' => 'Label ID', 'remark' => 'Remark', ]; } public function getGoods() { return $this->hasMany(HappinessMoveGoods::class, ['move_id' => 'id']); } public function getMallGood() { return $this->hasOne(Goods::class, ['id' => 'goods_id']); } public function getStore() { return $this->hasOne(HappinessStore::class, ['id' => 'store_id']); } public function getGiveStore() { return $this->hasOne(HappinessStore::class, ['id' => 'give_store_id']); } public static function setData($params) { try { if (isset($params['id']) && !empty($params['id'])) $model = self::findOne($params['id']); else { $model = new self(); $model->loadDefaultValues(); } if (!$model->load($params, '') || !$model->save()) { throw new \Exception($model->getErrorMessage()); } return $model; } catch (\Exception $e) { self::$static_error = $e->getMessage(); return false; } } }