|
|
@@ -33,6 +33,11 @@ class LiveOrderController extends BaseController
|
|
|
if(empty($arr) || is_array($arr) == false){
|
|
|
util::fail('没有客户信息');
|
|
|
}
|
|
|
+ $mainId = $this->mainId;
|
|
|
+ $hasItem = LiveOrderClass::getByCondition(['mainId'=>$mainId,'itemId'=>$itemId,'switch'=>0],true);
|
|
|
+ if(!empty($hasItem)){
|
|
|
+ util::fail('这个花材已添加过');
|
|
|
+ }
|
|
|
$has = [];
|
|
|
$customList = [];
|
|
|
foreach($arr as $key => $info){
|
|
|
@@ -50,7 +55,7 @@ class LiveOrderController extends BaseController
|
|
|
$connection = Yii::$app->db;
|
|
|
$transaction = $connection->beginTransaction();
|
|
|
try {
|
|
|
- LiveOrderClass::addOrder($params,$this->mainId);
|
|
|
+ LiveOrderClass::addOrder($params,$mainId);
|
|
|
$transaction->commit();
|
|
|
util::complete('创建成功');
|
|
|
} catch (\Exception $e) {
|