|
|
@@ -15,6 +15,22 @@ class HdController extends BaseController
|
|
|
|
|
|
public $guestAccess = ['list', 'info'];
|
|
|
|
|
|
+ public function actionRecover()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? 0;
|
|
|
+ $hd = HdClass::getById($id,true);
|
|
|
+ if (empty($hd)) {
|
|
|
+ util::fail('没有花店信息');
|
|
|
+ }
|
|
|
+ if ($hd['userId'] != $this->userId) {
|
|
|
+ util::fail('不是你的店');
|
|
|
+ }
|
|
|
+ $hd->delStatus = 0;
|
|
|
+ $hd->save();
|
|
|
+ util::complete('已恢复');
|
|
|
+ }
|
|
|
+
|
|
|
public function actionDel()
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
@@ -103,9 +119,11 @@ class HdController extends BaseController
|
|
|
|
|
|
public function actionList()
|
|
|
{
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $delStatus = $get['delStatus'] ?? 0;
|
|
|
$where = [];
|
|
|
$where['userId'] = $this->userId;
|
|
|
- $where['delStatus'] = 0;
|
|
|
+ $where['delStatus'] = $delStatus;
|
|
|
$respond = HdClass::getHdList($where);
|
|
|
util::success($respond);
|
|
|
}
|