|
|
@@ -92,7 +92,7 @@ class BookItemCustomController extends BaseController
|
|
|
$shop = $this->shop;
|
|
|
$bookSn = $shop->bookSn ?? 0;
|
|
|
if (empty($bookSn)) {
|
|
|
- util::fail('预订没有开户');
|
|
|
+ util::fail('预订没有开启');
|
|
|
}
|
|
|
$book = BookItemCustomClass::getById($id, true);
|
|
|
if (empty($book) || $book->bookSn != $bookSn) {
|
|
|
@@ -109,7 +109,54 @@ class BookItemCustomController extends BaseController
|
|
|
//批量上齐 ssh 20240812
|
|
|
public function actionBatchGoOn()
|
|
|
{
|
|
|
- util::complete();
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $ids = $post['ids']??'';
|
|
|
+
|
|
|
+ $staff = $this->shopAdmin;
|
|
|
+ if(isset($staff->identity) && $staff->identity == 2){
|
|
|
+ util::fail('不能操作');
|
|
|
+ }
|
|
|
+
|
|
|
+ $shop = $this->shop;
|
|
|
+ $bookSn = $shop->bookSn ?? 0;
|
|
|
+ if (empty($bookSn)) {
|
|
|
+ util::fail('预订没有开启');
|
|
|
+ }
|
|
|
+
|
|
|
+ if(empty($ids)){
|
|
|
+ util::fail('请选择要上齐的项');
|
|
|
+ }
|
|
|
+ $arr = json_decode($ids,true);
|
|
|
+ if(empty($arr)){
|
|
|
+ util::fail('请选择项');
|
|
|
+ }
|
|
|
+
|
|
|
+ $staff = $this->shopAdmin;
|
|
|
+ $staffId = $staff->id ?? 0;
|
|
|
+ $staffName = $staff->name ?? '';
|
|
|
+ $params = ['staffId' => $staffId, 'staffName' => $staffName, 'staff' => $staff];
|
|
|
+
|
|
|
+ $connection = Yii::$app->db;
|
|
|
+ $transaction = $connection->beginTransaction();
|
|
|
+ try {
|
|
|
+ foreach($arr as $id){
|
|
|
+ $num = 0;
|
|
|
+ $book = BookItemCustomClass::getById($id, true);
|
|
|
+ if (empty($book)) {
|
|
|
+ util::fail('有选择项没有找到');
|
|
|
+ }
|
|
|
+ if($book->bookSn != $bookSn){
|
|
|
+ util::fail('有选择的项不是当前预订活动');
|
|
|
+ }
|
|
|
+ BookItemCustomClass::goOn($book, $shop, $params, $num);
|
|
|
+ }
|
|
|
+ $transaction->commit();
|
|
|
+ util::complete();
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ Yii::info("操作失败原因:" . $e->getMessage());
|
|
|
+ $transaction->rollBack();
|
|
|
+ util::fail('操作失败');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//预订客户列表 ssh 20240616
|