提交 2f161252 authored 作者: 窦斌's avatar 窦斌

edit

上级 684029f9
......@@ -39,7 +39,7 @@ class SynOrderRejectedController extends BaseController
} else {
$db = new OrderList;
$params = ['sys_num' => $v['sys_num']];
$select = ['order_num', 'sys_num', 'serial_number', 'stauas', 'ser_id', 'p_id', 'order_goods_id', 'store_type', 'ol_dispamount', 'customer_id', 'id'];
$select = ['order_num', 'sys_num', 'serial_number', 'stauas', 'ser_id', 'p_id', 'order_goods_id', 'store_type', 'ol_dispamount', 'customer_id', 'id', 'company_id'];
$orderBy = ['stauas' => 'DESC'];
$orderListArrs = CommonService::getMysqlData($db, $params, $select, $orderBy);
if (!$orderListArrs) {
......
......@@ -1033,7 +1033,7 @@ class OrderListController extends BaseController
return "5 (原因:财务结算中)";exit;// 该单已审核
//return response()->json(['Data'=>'','ErrorMessage'=>'该单已审核','ErrorCode'=>4]);exit;
}
if($orderListArr['ser_id']=='617'){
/*if($orderListArr['ser_id']=='617'){
$url='http://order.autocamel.com/api/order.htm';//正式
$luot['orderid'] = $orderListArr['order_num'];
$luot['outorderid'] = "";
......@@ -1063,7 +1063,7 @@ class OrderListController extends BaseController
}
exit;
}
}
}*/
$resultOrderList = OrderList::where('sys_num',$input['sys_num'])->delete();
if($resultOrderList){
//$sql2 = 'INSERT INTO `gone_aftersale` (`afs_statues`,`afs_order`,`afs_serial`,`afs_sales`,`afs_granid`,`afs_paid`,`afs_type`,`afs_pid`,`afs_serid`,`afs_creactime`,`asf_time`,`afs_day`,`afs_creacter`,`afs_dealer`) VALUES ';
......@@ -1080,6 +1080,20 @@ class OrderListController extends BaseController
$data['day_time'] = 0;
$resultOrder = Orders::where('sys_num',$input['sys_num'])->update($data);
if($resultOrder){
$goodid=DB::table('order_msg')->where('sys_num',$input['sys_num'])->whereNotIn('goods_service',[2,3])->select('goods_id','goods_num')->get()->toArray();
//库存有关
if ($goodid){
$gsql = "";
$sql = "INSERT INTO `gone_invenrecor`( `iv_serid`, `iv_goodid`, `iv_num`,`iv_serial`,`iv_ordernum`,`iv_company_id`) VALUES";
foreach( $goodid as $kgi => $vgi){
$gsql .= "UPDATE `gone_inventory` SET `inv_num`=`inv_num`+".$vgi['goods_num']." WHERE `inv_serid`='".$orderListArr['ser_id']."' and `inv_goodid`='".$vgi['goods_id']."' and `inv_company_id`='".$orderListArr['company_id']."';";
$sql .= "('".$orderListArr['ser_id']."','".$vgi['goods_id']."','+".$vgi['goods_num']."','".$orderListArr['serial_number']."','".$orderListArr['order_num']."','".$orderListArr['company_id']."'),";
}
$sql = trim($sql,',');
DB::insert($sql);
DB::update($gsql);
}
DB::table("aftercust")->where("afc_order",$orderListArr['order_num'])->where("afc_refund",4)->update(['afc_state'=>'4']);
//计算接单率
$this->probability('2',$orderListArr['ser_id'],$orderListArr['stauas']);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论