更新pcb后台

parent 8fc775de
......@@ -3,6 +3,7 @@
namespace App\Model\Pcb;
use App\Map\PcbOrderMap;
use App\Model\UserMainModel;
use Illuminate\Database\Eloquent\Model;
use Request;
use DB;
......@@ -17,11 +18,11 @@ class PcbOrderModel extends Model
//列表
public function getList($type =1)
{
$arr = ['p', 'limit','self','start_time','end_time','status',"user_account","order_sn","purchase_sn","order_type","adtag","ptag"];
$arr = ['p', 'limit','self','start_time','end_time','status',"user_account","order_sn","purchase_sn","order_type","adtag","ptag","test_order"];
$input = Request::only($arr);
$input=TrimX($input,true,$arr);
// //查询数据\
//查询数据\
$list = $this->where(function ($query) use ($input) {
$PcbPurchaseModel = new PcbPurchaseModel();
foreach ($input as $k => $v){
......@@ -30,6 +31,7 @@ class PcbOrderModel extends Model
case "p":
case "limit":
case "_url":
case "test_order":
continue;
break;
case "start_time":
......@@ -56,6 +58,11 @@ class PcbOrderModel extends Model
}
}
})->orderBy('order_id','desc');
if (empty($input['test_order'])){ //排除测试账号
$testMobile = (new UserMainModel())->testMobile();
$list->whereNotIn('user_id', $testMobile);
}
//getSql();
if ($type == 1){
$input['limit'] = 10;
......
......@@ -86,6 +86,8 @@ class PcbPublicModel
$con->commit();
(new PcbServerModel())->pcb_delivered_customer($data['order_sn'],$data['shipping_no'],$data['shipping_name']);
return [0, '成功'];
}catch (\Exception $e) {
......
......@@ -75,4 +75,21 @@ class PcbServerModel
}
return $res;
}
/*
* 发送短信,发货给客户短信
* @param int $purchase_id 采购ID
*/
public function pcb_delivered_customer($order_sn,$shipping_no,$shipping_name){
$param = [
'order_sn'=> $order_sn ,
'shipping_no'=> $shipping_no ,
'shipping_name'=> $shipping_name ,
];
$res = curlApi($this->PcbUrl.'/pcb/adminapi/pcb_delivered_customer',$param,'POST');
$json = json_decode($res,true);
if ($json['err_code'] == 0){
PcbActionLogModel::log(1,'pcb_delivered_customer',"发货给客户短信",$order_sn);
}
return $res;
}
}
\ No newline at end of file
......@@ -13,6 +13,12 @@
<input type="text" name="end_time" id="end_time" value="<?= @$_GET['end_time'] ?>" placeholder="结束时间" style="float: left;margin-left: 10px;" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">是否包括测试:</label>
<div class="layui-input-inline">
<input type="checkbox" lay-ignore name="test_order" <?php if (@$_GET['test_order']) echo "checked='checked'" ?> >
</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment