This commit is contained in:
mkm 2023-11-04 18:42:25 +08:00
parent f940cd20bc
commit e34bd3df99
5 changed files with 33 additions and 17 deletions

View File

@ -304,6 +304,9 @@ class StoreOrder extends BaseController
return app('json')->success(['qrcode' => $this->repository->wxQrcode($id, $order->verify_code)]);
}
/**
* 生成二维码
*/
public function logisticsCode($id)
{
$storeInfo = Db::name('store_service')->where('uid', $this->request->uid())->find();

View File

@ -67,15 +67,14 @@ class StoreOrderBehalf extends BaseController
[$page, $limit] = $this->getPage();
$status = $this->request->param('status',1);
$uid= $this->request->userInfo()['uid'];
$mer_id= Db::name('store_service')->where('uid',$uid)->where('is_del',0)->value('mer_id');
if($mer_id){
$column= Db::name('store_order_behalf')->where('mer_id',$mer_id)->where('status',$status)->page($page)->limit($limit)->column('order_id');
if($column){
$where['order_id']=$column;
return app('json')->success($this->repository->getList($where, 1, 100));
}
$uid = $this->request->userInfo()['uid'];
$mer_id = Db::name('store_service')->where('uid', $uid)->where('is_del', 0)->value('mer_id');
if ($mer_id) {
$column = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status', $status)->page($page)->limit($limit)->column('order_id');
if ($column) {
$where['order_id'] = $column;
return app('json')->success($this->repository->getList($where, 1, 100));
}
}
return app('json')->success([]);
}
@ -98,14 +97,22 @@ class StoreOrderBehalf extends BaseController
}
/**
* @return mixed
* @author xaboy
* @day 2020/6/10
* 生成二维码
*/
public function number()
public function logisticsCode($id)
{
$productType = $this->request->param('product_type', 0);
return app('json')->success($this->repository->userOrderNumber($this->request->uid(), $productType));
}
$status = $this->request->param('status',1);
$order_id = $this->request->param('order_id',0);
$uid = $this->request->userInfo()['uid'];
$mer_id = Db::name('store_service')->where('uid', $uid)->where('is_del', 0)->value('mer_id');
if ($mer_id) {
$order_id = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status', $status)->where('order_id',$order_id)->value('order_id');
if ($order_id) {
$order = $this->repository->getWhere(['order_id' => $id,'is_del' => 0]);
return app('json')->success(['qrcode' => $this->repository->logisticsQrcode($id, $order->order_sn)]);
}
}
return app('json')->fail('信息有误:请联系官方人员');
}
}

View File

@ -115,6 +115,10 @@ class CloudWarehouse extends BaseController
->withAttr('merchant',function($value,$data){
return Db::name('merchant')->where('mer_id',$data['mer_id'])->field('mer_id,mer_name')->find();
})
->withAttr('sku',function($value,$data){
$find= Db::name('store_product_attr_value')->where('mer_id',$data['mer_id'])->where('product_id',$data['product_id'])->find();
return[''=>$find];
})
// ->field('product_id,mer_id,store_name,bar_code,price,stock,product_type,image')
->select();
return app('json')->success(['count'=>$count,'list'=>$select]);

View File

@ -34,7 +34,8 @@ class paySuccess
$orderList = $event['groupOrder']['orderList'];
foreach ($orderList as $k => $order) {
$merchant = Merchant::find($order['mer_id']);
if($merchant['type_id']==13){
//添加到代发订单表里
if($merchant['type_id']==Merchant::TypeSupplyChain){
$codes=explode(',',$order['user_address_code']);
if(count($codes)>4){
$merchant_two= Db::name('merchant')->where('street_id',$codes[3])->where('type_id',17)->where('category_id',$merchant['category_id'])->find();

View File

@ -347,6 +347,7 @@ Route::group('api/', function () {
//代发货订单
Route::group('behalf_admin', function () {
Route::get('/order_list', '/lst');
Route::get('/code', '/logisticsCode');
})->prefix('api.store.order.StoreOrderBehalf');
//管理员申请转账
Route::get('admin/:merId/apply', 'api.store.merchant.Merchant/apply');