255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'express_id' => 'Express ID', 'order_no' => 'Order No', 'order_id' => 'Order ID', 'goods_id' => 'Goods ID', 'attr_id' => 'Attr ID', 'num' => 'Num', 'mall_id' => 'Mall ID', 'status' => 'Status', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } public static function setData(array $params) { try { if(isset($params['id']) && !empty($params['id'])) $model = self::findOne($params['id']); else { $model = new self(); $model->loadDefaultValues(); } if(!$model) { $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; } } }