|
@@ -86,13 +86,12 @@ class Order extends Backend
|
|
|
*/
|
|
|
public function submitordernew(){
|
|
|
if(!$this->request->isPost()){
|
|
|
- $this->assign('staff_id',$this->auth->staff_id);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|
|
|
$data = request_post_hub([
|
|
|
'user_name','user_car_number','user_mobile','user_address',
|
|
|
- 'servicetype_id','server_time','server_info','server_images','pay_fee'
|
|
|
+ 'servicetype_id','server_time','server_info','server_images','pay_fee','company_id','staff_id'
|
|
|
]);
|
|
|
|
|
|
Db::startTrans();
|
|
@@ -113,8 +112,6 @@ class Order extends Backend
|
|
|
|
|
|
$data['orderno'] = createUniqueNo('O',$user_info['id']);
|
|
|
$data['ordertype'] = 2;
|
|
|
- $data['company_id'] = $this->auth->company_id;
|
|
|
- $data['staff_id'] = $this->auth->staff_id;
|
|
|
$data['total_fee'] = $data['pay_fee'];
|
|
|
|
|
|
$data['status'] = 2;
|
|
@@ -190,7 +187,6 @@ class Order extends Backend
|
|
|
$this->assign('id',$id);
|
|
|
$info = Db::name('order')->where('id',$id)->find();
|
|
|
$this->assign('info',$info);
|
|
|
- $this->assign('staff_id',$this->auth->staff_id);
|
|
|
|
|
|
|
|
|
$baoyang_switch = Db::name('servicetype')->where('id',$info['servicetype_id'])->value('baoyang_switch');
|
|
@@ -216,7 +212,7 @@ class Order extends Backend
|
|
|
|
|
|
|
|
|
$time = time();
|
|
|
- $updateData = ['status'=>3,'finish_time'=>time(),'staff_id'=>$this->auth->staff_id];
|
|
|
+ $updateData = ['status'=>3,'finish_time'=>time()];
|
|
|
$updateData = array_merge($updateData,$baoyang_data);
|
|
|
$rs = Db::name('order')->where('id',$id)->update($updateData);
|
|
|
if($rs === false){
|
|
@@ -226,7 +222,7 @@ class Order extends Backend
|
|
|
|
|
|
|
|
|
if($info['ordertype'] == 3 && $info['paytype'] == 3 && $info['pay_fee'] > 0){
|
|
|
- $wallet_rs = model('walletcompany')->lockChangeAccountRemain($this->auth->company_id,'money',$info['pay_fee'],203,$remark='套餐订单完成服务','order',$id);
|
|
|
+ $wallet_rs = model('walletcompany')->lockChangeAccountRemain($info['company_id'],'money',$info['pay_fee'],203,$remark='套餐订单完成服务','order',$id);
|
|
|
if($wallet_rs['status'] === false){
|
|
|
Db::rollback();
|
|
|
$this->error($wallet_rs['msg']);
|