diff --git a/app/api/controller/StoreKeeper.php b/app/api/controller/StoreKeeper.php index f38c0a12..d37b7a8a 100644 --- a/app/api/controller/StoreKeeper.php +++ b/app/api/controller/StoreKeeper.php @@ -13,6 +13,7 @@ declare (strict_types=1); namespace app\api\controller; use app\api\service\User as UserService; +use app\common\enum\RecoveryStatusEnum; use app\store\model\article\Category as CategoryModel; use app\store\model\Express as ExpressModel; use app\store\model\store\Address as AddressModel; @@ -56,6 +57,8 @@ class StoreKeeper extends Controller */ public function list(): Json { + + RecoveryStatusEnum::keys(); // 获取列表记录 $model = new GoodsModel; $list = $model->getList($this->request->param()); diff --git a/app/api/model/ActiveCol.php b/app/api/model/ActiveCol.php index 3d420357..b41f1b4e 100644 --- a/app/api/model/ActiveCol.php +++ b/app/api/model/ActiveCol.php @@ -20,15 +20,15 @@ use app\common\model\ActiveCol as ActiveColModel; */ class ActiveCol extends ActiveColModel { - //追加字段 - protected $append = [ - 'col_pic' - ]; - - public function getColPicAttr($value, $data) { - $file = $this->with(['colImage'])->find(); - return $file['col_image_url']; - } +// //追加字段 +// protected $append = [ +// 'col_pic' +// ]; +// +// public function getColPicAttr($value, $data) { +// $file = $this->with('colImage')->find(); +// return $file['col_image_url']; +// } } diff --git a/app/api/model/ActiveMain.php b/app/api/model/ActiveMain.php index 8e07748e..4baaa967 100644 --- a/app/api/model/ActiveMain.php +++ b/app/api/model/ActiveMain.php @@ -33,7 +33,7 @@ class ActiveMain extends ActiveMainModel public function getList($param) { - return $this->with('col') + return $this->with('col.colImage') ->where('status', '=', 1) ->where('id', $param['active_id']) ->find(); diff --git a/app/common/model/ActiveCol.php b/app/common/model/ActiveCol.php index ca843b50..c9c21ba7 100644 --- a/app/common/model/ActiveCol.php +++ b/app/common/model/ActiveCol.php @@ -28,6 +28,7 @@ class ActiveCol extends BaseModel // 定义主键 protected $pk = 'id'; + /** * col_image关联 * @return HasOne @@ -35,7 +36,7 @@ class ActiveCol extends BaseModel public function colImage(): HasOne { return $this->hasOne('UploadFile', 'file_id', 'col_image_id') - ->bind(['col_image_url' => 'preview_url']); + ->bind(['col_pic' => 'preview_url']); } }