FreeQueueForm.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace app\modules\admin\models;
  8. use app\models\FreeQueue;
  9. use app\models\FreeQueueGoods;
  10. use app\models\Goods;
  11. use app\models\Order;
  12. use app\models\QueueAccountLog;
  13. use app\models\QueueLog;
  14. use app\models\User;
  15. use app\utils\OrderUtil;
  16. use yii\base\Model;
  17. class FreeQueueForm extends Model
  18. {
  19. public $store_id;
  20. public $id;
  21. public $ids;
  22. public $queue_id;
  23. public $name;
  24. public $mobile;
  25. public $order_no;
  26. public $activity_name;
  27. public $start_time;
  28. public $end_time;
  29. public $status;
  30. public $goods_ext;
  31. public $goods_ids;
  32. public $can_out;
  33. public $cashback_bili;
  34. public $single_bili;
  35. public $coupon_ids;
  36. public $goods_name;
  37. public $coupon_name;
  38. public $buy_limit;
  39. public $is_platform = 0;
  40. public $self_bili = 0;
  41. public $share_bili = 0;
  42. public $is_platform_audit = 0;
  43. public $store_name;
  44. public function rules()
  45. {
  46. return [
  47. [['status', 'id', 'is_platform', 'is_platform_audit', 'queue_id', 'mobile'], 'integer'],
  48. [['start_time', 'end_time', 'ids', 'name', 'store_name', 'activity_name', 'order_no'], 'string'],
  49. [['single_bili', 'cashback_bili', 'self_bili', 'share_bili'], 'number'],
  50. [['goods_name', 'coupon_name', 'store_id', 'goods_ids', 'goods_ext', 'coupon_ids', 'buy_limit', 'can_out'], 'safe'],
  51. ];
  52. }
  53. public function init()
  54. {
  55. parent::init();
  56. if (empty($this->store_id)) {
  57. $this->store_id = get_store_id();
  58. }
  59. }
  60. public function search()
  61. {
  62. try {
  63. $query = FreeQueue::find()->where(['is_delete' => 0, 'store_id' => get_store_id()]);
  64. if ((int)$this->status === 1) { //未开始
  65. $query->andWhere(['>', 'start_time', time()]);
  66. }
  67. if ((int)$this->status === 2) { //进行中
  68. $query->andWhere(['AND', ['<', 'start_time', time()], ['>', 'end_time', time()]]);
  69. }
  70. if ((int)$this->status === 3) { //已结束
  71. $query->andWhere(['<', 'end_time', time()]);
  72. }
  73. if (!empty($this->name)) { //名称
  74. $query->andWhere(['LIKE', 'name', $this->name]);
  75. }
  76. if (!empty($this->start_time)) {
  77. $query->andWhere(['>', 'end_time', strtotime($this->start_time)]);
  78. }
  79. if (!empty($this->end_time)) {
  80. $query->andWhere(['<', 'start_time', strtotime($this->end_time)]);
  81. }
  82. $query->andWhere(['is_platform' => $this->is_platform])->orderBy('id desc');
  83. $pagination = pagination_make($query);
  84. foreach ($pagination['list'] as &$item) {
  85. $item['publish'] = $item['status'];
  86. //获取活动状态
  87. if ($item['start_time'] > time()) {
  88. $item['status'] = 1;
  89. }
  90. if ($item['start_time'] < time() && $item['end_time'] > time()) {
  91. $item['status'] = 2;
  92. }
  93. if ($item['end_time'] < time()) {
  94. $item['status'] = 3;
  95. }
  96. //格式化时间
  97. $item['start_time'] = date("Y-m-d H:i:s", $item['start_time']);
  98. $item['end_time'] = date("Y-m-d H:i:s", $item['end_time']);
  99. $item['created_at'] = date("Y-m-d H:i:s", $item['created_at']);
  100. $item['updated_at'] = date("Y-m-d H:i:s", $item['updated_at']);
  101. //参与人数
  102. $item['num'] = QueueLog::find()->where(['queue_id' => $item['id']])->andWhere(['!=', 'status', 2])->count() ?? 0;;
  103. }
  104. return [
  105. 'code' => 0,
  106. 'msg' => 'success',
  107. 'data' => [
  108. 'data' => $pagination['list'],
  109. 'pageNo' => $pagination['pageNo'],
  110. 'totalCount' => $pagination['totalCount'],
  111. ]
  112. ];
  113. } catch (\Exception $e) {
  114. return [
  115. 'code' => 1,
  116. 'msg' => $e->getMessage()
  117. ];
  118. }
  119. }
  120. public function searchActivity()
  121. {
  122. try {
  123. $query = FreeQueueGoods::find()
  124. ->alias('fg')
  125. ->leftJoin(['fq' => FreeQueue::tableName()], 'fq.id = fg.activity_id')
  126. ->leftJoin(['g' => Goods::tableName()], 'g.id = fg.goods_id')
  127. ->where(['fq.is_delete' => 0, 'fq.store_id' => get_store_id()]);
  128. if ((int)$this->status === 1) { //未开始
  129. $query->andWhere(['>', 'fq.start_time', time()]);
  130. }
  131. if ((int)$this->status === 2) { //进行中
  132. $query->andWhere(['AND', ['<', 'fq.start_time', time()], ['>', 'fq.end_time', time()]]);
  133. }
  134. if ((int)$this->status === 3) { //已结束
  135. $query->andWhere(['<', 'fq.end_time', time()]);
  136. }
  137. if (!empty($this->activity_name)) { //名称
  138. $query->andWhere(['LIKE', 'fq.name', $this->activity_name]);
  139. }
  140. if (!empty($this->name)) { //名称
  141. $query->andWhere(['LIKE', 'g.name', $this->name]);
  142. }
  143. if (!empty($this->start_time)) {
  144. $query->andWhere(['>', 'fq.end_time', strtotime($this->start_time)]);
  145. }
  146. if (!empty($this->end_time)) {
  147. $query->andWhere(['<', 'fq.start_time', strtotime($this->end_time)]);
  148. }
  149. $query->andWhere(['fq.is_platform' => $this->is_platform]);
  150. $query->select('fg.*,g.name,fq.name as activity_name,g.cover_pic')->orderBy('fg.id DESC');
  151. $pagination = pagination_make($query);
  152. foreach ($pagination['list'] as &$item) {
  153. $item['publish'] = $item['status'];
  154. //获取活动状态
  155. if ($item['start_time'] > time()) {
  156. $item['status'] = 1;
  157. }
  158. if ($item['start_time'] < time() && $item['end_time'] > time()) {
  159. $item['status'] = 2;
  160. }
  161. if ($item['end_time'] < time()) {
  162. $item['status'] = 3;
  163. }
  164. //参与人数
  165. $item['num'] = QueueLog::find()->where(['store_id' => get_store_id(), 'goods_id' => $item['goods_id']])->andWhere(['!=', 'status', 2])->count() ?? 0;
  166. //格式化时间
  167. $item['start_time'] = date("Y-m-d H:i:s", $item['start_time']);
  168. $item['end_time'] = date("Y-m-d H:i:s", $item['end_time']);
  169. $item['created_at'] = date("Y-m-d H:i:s", $item['created_at']);
  170. $item['updated_at'] = date("Y-m-d H:i:s", $item['updated_at']);
  171. }
  172. return [
  173. 'code' => 0,
  174. 'msg' => 'success',
  175. 'data' => [
  176. 'data' => $pagination['list'],
  177. 'pageNo' => $pagination['pageNo'],
  178. 'totalCount' => $pagination['totalCount'],
  179. ]
  180. ];
  181. } catch (\Exception $e) {
  182. return [
  183. 'code' => 1,
  184. 'msg' => $e->getMessage()
  185. ];
  186. }
  187. }
  188. /**
  189. * 活动详情
  190. * @return array
  191. */
  192. public function searchActivityDetail()
  193. {
  194. try {
  195. $query = QueueLog::find()
  196. ->alias('ql')
  197. ->leftJoin(['o' => Order::tableName()], 'ql.order_id = o.id')
  198. ->leftJoin(['fq' => FreeQueue::tableName()], 'fq.id = ql.queue_id')
  199. ->leftJoin(['fg' => FreeQueueGoods::tableName()], 'fg.activity_id = fq.id')
  200. ->leftJoin(['u' => User::tableName()], 'u.id = ql.user_id')
  201. ->where(['fq.is_delete' => 0, 'ql.store_id' => get_store_id()])
  202. ->andWhere(['!=', 'ql.status', 2]);
  203. if ($this->queue_id) {
  204. $query->andWhere(['fg.id' => $this->queue_id]);
  205. }
  206. if ((int)$this->status === 1) { //待返现
  207. $query->andWhere(['=', 'ql.status', 0]);
  208. }
  209. if ((int)$this->status === 2) { //进行中
  210. $query->andWhere(['=', 'ql.status', 3]);
  211. }
  212. if ((int)$this->status === 3) { //已完成
  213. $query->andWhere(['=', 'ql.status', 1]);
  214. }
  215. if (!empty($this->name)) { //用户名称
  216. $query->andWhere(['LIKE', 'u.nickname', $this->name]);
  217. }
  218. if (!empty($this->mobile)) { //手机号
  219. $query->andWhere(['LIKE', 'u.binding', $this->mobile]);
  220. }
  221. if (!empty($this->order_no)) { //订单号
  222. $query->andWhere(['LIKE', 'o.order_no', $this->order_no]);
  223. }
  224. $query->select('ql.*,o.order_no,u.nickname,u.binding,u.avatar_url');
  225. // print_r($query);die();
  226. $query->orderBy('ql.id desc');
  227. $pagination = pagination_make($query);
  228. foreach ($pagination['list'] as &$item) {
  229. $item['status'] = intval($item['status']);
  230. //未返金额
  231. $item['un_money'] = round(($item['total_money'] - $item['returned_money']), 2);
  232. //格式化时间
  233. $item['start_time'] = date("Y-m-d H:i:s", $item['start_time']);
  234. $item['end_time'] = date("Y-m-d H:i:s", $item['end_time']);
  235. $item['created_at'] = date("Y-m-d H:i:s", $item['created_at']);
  236. $item['updated_at'] = date("Y-m-d H:i:s", $item['updated_at']);
  237. $item['sort'] = OrderUtil::getQueueSort($item['queue_id'], $item['id'])['current_sort'];
  238. $from_queue_list_arr = (array)json_decode($item['order_detail_total_price_list'], true);
  239. foreach($from_queue_list_arr as &$que){
  240. $order = Order::findOne($que['order_id']);
  241. $que['order'] = $order;
  242. $que['user'] = User::findOne($order['user_id']);
  243. $que['saas_user'] = \app\models\SaasUser::findOne(['mobile' => $que['user']['binding']]);
  244. }
  245. $item['order_detail_total_price_list_arr'] = $from_queue_list_arr;
  246. }
  247. return [
  248. 'code' => 0,
  249. 'msg' => 'success',
  250. 'data' => [
  251. 'data' => $pagination['list'],
  252. 'pageNo' => $pagination['pageNo'],
  253. 'totalCount' => $pagination['totalCount'],
  254. ]
  255. ];
  256. } catch (\Exception $e) {
  257. return [
  258. 'code' => 1,
  259. 'msg' => $e->getMessage()
  260. ];
  261. }
  262. }
  263. /**
  264. * 参与活动记录
  265. * @return array
  266. */
  267. public function searchJoin()
  268. {
  269. try {
  270. $query = QueueLog::find()
  271. ->alias('ql')
  272. ->leftJoin(['o' => Order::tableName()], 'ql.order_id = o.id')
  273. ->leftJoin(['fq' => FreeQueue::tableName()], 'fq.id = ql.queue_id')
  274. ->leftJoin(['fg' => FreeQueueGoods::tableName()], 'fg.activity_id = fq.id')
  275. ->leftJoin(['u' => User::tableName()], 'u.id = ql.user_id')
  276. ->where(['fq.is_delete' => 0, 'ql.store_id' => get_store_id()])
  277. ->andWhere(['!=', 'ql.status', 2]);
  278. if ($this->queue_id) {
  279. $query->andWhere(['fg.id' => $this->queue_id]);
  280. }
  281. if ((int)$this->status === 1) { //待返现
  282. $query->andWhere(['=', 'ql.status', 0]);
  283. }
  284. if ((int)$this->status === 2) { //进行中
  285. $query->andWhere(['=', 'ql.status', 3]);
  286. }
  287. if ((int)$this->status === 3) { //已完成
  288. $query->andWhere(['=', 'ql.status', 1]);
  289. }
  290. if (!empty($this->name)) { //用户名称
  291. $query->andWhere(['LIKE', 'u.nickname', $this->name]);
  292. }
  293. if (!empty($this->mobile)) { //手机号
  294. $query->andWhere(['LIKE', 'u.binding', $this->mobile]);
  295. }
  296. if (!empty($this->order_no)) { //订单号
  297. $query->andWhere(['LIKE', 'o.order_no', $this->order_no]);
  298. }
  299. if (!empty($this->goods_name)) { //商品名称
  300. $query->andWhere(['LIKE', 'ql.goods_name', $this->goods_name]);
  301. }
  302. $query->select('ql.*,o.order_no,u.nickname,u.binding,u.avatar_url');
  303. // print_r($query);die();
  304. $query->orderBy('ql.id desc')->groupBy('ql.id');
  305. $pagination = pagination_make($query);
  306. foreach ($pagination['list'] as &$item) {
  307. $item['status'] = intval($item['status']);
  308. //未返金额
  309. $item['un_money'] = round(($item['total_money'] - $item['returned_money']), 2);
  310. //格式化时间
  311. $item['start_time'] = date("Y-m-d H:i:s", $item['start_time']);
  312. $item['end_time'] = date("Y-m-d H:i:s", $item['end_time']);
  313. $item['created_at'] = date("Y-m-d H:i:s", $item['created_at']);
  314. $item['updated_at'] = date("Y-m-d H:i:s", $item['updated_at']);
  315. $item['sort'] = OrderUtil::getQueueSort($item['queue_id'], $item['id'])['current_sort'];
  316. $from_queue_list_arr = (array)json_decode($item['order_detail_total_price_list'], true);
  317. foreach($from_queue_list_arr as &$que){
  318. $order = Order::findOne($que['order_id']);
  319. $que['order'] = $order;
  320. $que['user'] = User::findOne($order['user_id']);
  321. $que['saas_user'] = \app\models\SaasUser::findOne(['mobile' => $que['user']['binding']]);
  322. }
  323. $item['order_detail_total_price_list_arr'] = $from_queue_list_arr;
  324. }
  325. return [
  326. 'code' => 0,
  327. 'msg' => 'success',
  328. 'data' => [
  329. 'data' => $pagination['list'],
  330. 'pageNo' => $pagination['pageNo'],
  331. 'totalCount' => $pagination['totalCount']
  332. ]
  333. ];
  334. } catch (\Exception $e) {
  335. return [
  336. 'code' => 1,
  337. 'msg' => $e->getMessage()
  338. ];
  339. }
  340. }
  341. /**
  342. * 参与记录详情
  343. * @return array
  344. */
  345. public function searchJoinDetail()
  346. {
  347. if ($this->id) {
  348. // 参与记录详情
  349. $queueDetail = QueueLog::find()
  350. ->alias('ql')
  351. ->leftJoin(['u' => User::tableName()], 'u.id = ql.user_id')
  352. ->where(['ql.id' => $this->id, 'ql.store_id' => $this->store_id])
  353. ->andWhere(['!=', 'ql.status', 2])
  354. ->select('ql.*,u.binding')
  355. ->asArray()
  356. ->one();
  357. $queueDetail['created_at'] = date('Y-m-d H:i:s', $queueDetail['created_at']);
  358. $queueDetail['un_money'] = round(($queueDetail['total_money'] - $queueDetail['returned_money']), 2);
  359. $queueDetail['sort'] = OrderUtil::getQueueSort($queueDetail['queue_id'], $queueDetail['id'])['current_sort'];
  360. $from_queue_list_arr = (array)json_decode($queueDetail['order_detail_total_price_list'], true);
  361. foreach($from_queue_list_arr as &$que){
  362. $order = Order::findOne($que['order_id']);
  363. $que['order'] = $order;
  364. $que['user'] = User::findOne($order['user_id']);
  365. $que['saas_user'] = \app\models\SaasUser::findOne(['mobile' => $que['user']['binding']]);
  366. }
  367. $queueDetail['order_detail_total_price_list_arr'] = $from_queue_list_arr;
  368. $goodsList = Goods::find()
  369. ->where(['in', 'id', [$queueDetail['goods_id']], 'store_id' => $this->store_id, 'is_delete' => 0])
  370. ->asArray()
  371. ->all();
  372. $goodsList[0]['num'] = $queueDetail['num'];
  373. $query = QueueAccountLog::find()->alias('qal')
  374. ->leftJoin(['ql' => QueueLog::tableName()], 'qal.from_queue_id = ql.id')
  375. ->leftJoin(['o' => Order::tableName()], 'o.id = ql.order_id')
  376. ->leftJoin(['u' => User::tableName()], 'u.id = ql.user_id')
  377. ->where(['qal.queue_id' => $this->id, 'qal.log_type' => 1]);
  378. $query->select(['qal.*', 'u.binding', 'u.avatar_url', 'u.nickname', 'o.order_no']);
  379. $list = pagination_make($query);
  380. foreach($list['list'] as &$item){
  381. $from_queue_list_arr = (array)json_decode($item['from_queue_list'], true);
  382. foreach($from_queue_list_arr as $i => &$que){
  383. if($i > 0 && $que['order_id'] == $from_queue_list_arr[$i-1]['order_id']){
  384. $que['money'] += $from_queue_list_arr[$i-1]['money'];
  385. unset($from_queue_list_arr[$i-1]);
  386. }
  387. }
  388. $from_queue_list_arr = array_values($from_queue_list_arr);
  389. foreach($from_queue_list_arr as &$que){
  390. $queue_log = QueueLog::findOne($que['from_queue_log_id']);
  391. $order = Order::findOne($queue_log['order_id']);
  392. $que['queue_log'] = $queue_log;
  393. $que['order'] = $order;
  394. $que['user'] = User::findOne($order['user_id']);
  395. $que['saas_user'] = \app\models\SaasUser::findOne(['mobile' => $que['user']['binding']]);
  396. }
  397. $item['from_queue_list_arr'] = $from_queue_list_arr;
  398. }
  399. $data = [
  400. 'data' => $list['list'],
  401. 'pageNo' => $list['pageNo'],
  402. 'totalCount' => $list['totalCount'],
  403. 'queueDetail' => $queueDetail,
  404. 'goodsList' => $goodsList,
  405. ];
  406. return [
  407. 'code' => 0,
  408. 'msg' => 'success',
  409. 'data' => $data,
  410. ];
  411. } else {
  412. return [
  413. 'code' => 1,
  414. 'msg' => '参数错误',
  415. ];
  416. }
  417. }
  418. public function getInfo()
  419. {
  420. try {
  421. $activity = FreeQueue::find()->where(['id' => $this->id])->one();
  422. if ($activity) {
  423. $activity_goods = Goods::find()->where(['in', 'id', explode(',', $activity->goods_ids)])->andWhere(['is_delete' => 0])->asArray()->all();
  424. $activity['start_time'] = date("Y-m-d H:i:s", $activity['start_time']);
  425. $activity['end_time'] = date("Y-m-d H:i:s", $activity['end_time']);
  426. $goods_ext = FreeQueueGoods::findAll(['activity_id' => $activity->id, 'is_delete' => 0]);
  427. }
  428. return [
  429. 'code' => 0,
  430. 'msg' => '获取成功',
  431. 'data' => [
  432. 'activity_goods' => $activity_goods ?? [],
  433. 'goods_ext' => $goods_ext ?? [],
  434. 'activity_coupons' => $activity_coupons ?? [],
  435. 'activity' => $activity ?: []
  436. ]
  437. ];
  438. } catch (\Exception $e) {
  439. return [
  440. 'code' => 1,
  441. 'msg' => $e->getMessage() . $e->getFile() . $e->getLine()
  442. ];
  443. }
  444. }
  445. public function save($params = [])
  446. {
  447. $t = \Yii::$app->db->beginTransaction();
  448. try {
  449. if (!$this->name || !$this->start_time || !$this->end_time) {
  450. throw new \Exception("请将参数填充完整");
  451. }
  452. $activity = FreeQueue::findOne($this->id);
  453. if (empty($activity)) {
  454. $activity = new FreeQueue();
  455. $activity->store_id = $this->store_id;
  456. }
  457. $activity->name = $this->name;
  458. $activity->cashback_bili = $this->cashback_bili;
  459. $activity->single_bili = $this->single_bili;
  460. $activity->self_bili = $this->self_bili;
  461. $activity->share_bili = $this->share_bili;
  462. $activity->start_time = strtotime($this->start_time);
  463. $activity->end_time = strtotime($this->end_time);
  464. $activity->goods_ids = $this->goods_ids;
  465. $activity->can_out = $this->can_out;
  466. isset($params['cashback_time']) && $activity->cashback_time = (int)$params['cashback_time'];
  467. isset($params['cashback_type']) && $activity->cashback_type = (int)$params['cashback_type'];
  468. isset($params['cashback_money']) && $activity->cashback_money = (float)$params['cashback_money'];
  469. isset($params['cashback_money_bili']) && $activity->cashback_money_bili = (float)$params['cashback_money_bili'];
  470. $goods_ids = \explode(',', $this->goods_ids);
  471. foreach ($goods_ids as $goods_id) {
  472. $flag = FreeQueueGoods::find()->where(['goods_id' => $goods_id]);
  473. if ($this->id) {
  474. $flag->andWhere(['<>', 'activity_id', $this->id]);
  475. }
  476. if ($flag->one()) {
  477. throw new \Exception('该商品已参与其他活动');
  478. }
  479. }
  480. $activity->is_platform = (int)$this->is_platform;
  481. if (!$activity->save()) {
  482. throw new \Exception(json_encode($activity->errors));
  483. }
  484. if (!empty($this->goods_ext)) {
  485. foreach ($this->goods_ext as &$item) {
  486. $item['activity_id'] = $activity->id;
  487. $item['store_id'] = $this->store_id;
  488. }
  489. FreeQueueGoods::saveAll($this->goods_ext, $activity->id);
  490. }
  491. $t->commit();
  492. return [
  493. 'code' => 0,
  494. 'msg' => '操作成功!'
  495. ];
  496. } catch (\Exception $e) {
  497. $t->rollBack();
  498. return [
  499. 'code' => 1,
  500. 'msg' => $e->getMessage()
  501. ];
  502. }
  503. }
  504. public function setStatus()
  505. {
  506. try {
  507. if ($this->ids) {
  508. $ids = explode(',', $this->ids);
  509. if (in_array($this->status, [0, 1])) {
  510. FreeQueue::updateAll(['status' => $this->status], ['and', ['in', 'id', $ids], ['store_id' => get_store_id()]]);
  511. }
  512. if ((int)$this->status === 2) {
  513. foreach ($ids as $id) {
  514. $is = QueueLog::find()->where('`queue_id` = :queue_id AND `is_meet` = 0 AND `status` != 2', [':queue_id' => $id])->one();
  515. if ($is) {
  516. return [
  517. 'code' => 0,
  518. 'msg' => '当前活动还有未完成的队列,暂时不能删除'
  519. ];
  520. }
  521. }
  522. FreeQueue::updateAll(['is_delete' => 1], ['in', 'id', $ids]);
  523. FreeQueueGoods::deleteAll(['in', 'activity_id', $ids]);
  524. }
  525. }
  526. return [
  527. 'code' => 0,
  528. 'msg' => '操作成功!'
  529. ];
  530. } catch (\Exception $e) {
  531. return [
  532. 'code' => 1,
  533. 'msg' => $e->getMessage()
  534. ];
  535. }
  536. }
  537. }