|
@@ -1211,7 +1211,7 @@ class Sale extends Base
|
|
|
return error_show(1004,"未找到方案信息");
|
|
|
}
|
|
|
$feedid = array_column($feedbackid,"feedback_id");
|
|
|
- foreach ($planinfo as $value){
|
|
|
+ foreach ($planinfo as $key=>$value){
|
|
|
$good=[];
|
|
|
$feedback = Db::name("project_feedback")->where(["id"=>$value['feedback_id'],"projectNo"=>$plan['projectNo'],
|
|
|
"is_del"=>0])->find();
|
|
@@ -1285,8 +1285,18 @@ class Sale extends Base
|
|
|
return error_show(1002, "项目订单生成失败");
|
|
|
}
|
|
|
|
|
|
- //处理台账
|
|
|
- Db::name('standing_book')->where('projectNo',$plan['projectNo'])->update($standing_book_data);
|
|
|
+ //处理台账(一个项目会生成多个销售订单,第一个更新,其余的新增)
|
|
|
+ if ($key == 0) Db::name('standing_book')->where('projectNo', $plan['projectNo'])->update($standing_book_data);
|
|
|
+ else {
|
|
|
+ $temp = Db::name('standing_book')->where('projectNo', $plan['projectNo'])->find();
|
|
|
+ if (!empty($temp)) {
|
|
|
+ unset($temp['id']);
|
|
|
+ $temp = array_merge($temp, $standing_book_data);
|
|
|
+ $temp['standBookNo'] = makeNo('IO');
|
|
|
+ Db::name('standing_book')->insert($temp);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
$old_plan_status = $plan['status'];
|
|
|
$plan['status']=2;
|