更新
This commit is contained in:
parent
1dffc48f28
commit
0fae7f018b
@ -642,7 +642,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
if ($product_type == 98 || $product_type == 99) {
|
||||
$isUser = 0;
|
||||
}
|
||||
$noPay = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(1))->whereRaw("(StoreOrder.paid=0 and StoreOrder.pay_type!=8) or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)")->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$noPay = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(1))->whereRaw("(StoreOrder.paid=0 and StoreOrder.pay_type!=8) or (StoreOrder.paid=1 and StoreOrder.pay_type=8 and StoreOrder.status=2)")->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count();
|
||||
$noPostage = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(2))->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$noDeliver = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(3))->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
$noComment = $this->dao->search(['uid' => $uid, 'is_user' => $isUser])->where($this->getOrderType(4))->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->fetchSql(false)->count();
|
||||
|
@ -30,6 +30,7 @@ use crmeb\services\LockService;
|
||||
use think\facade\Db;
|
||||
use think\App;
|
||||
use think\facade\Log;
|
||||
use app\common\dao\store\order\StoreOrderDao;
|
||||
|
||||
/**代发订单
|
||||
* Class StoreOrder
|
||||
@ -43,16 +44,18 @@ class StoreOrderBehalf extends BaseController
|
||||
* @var StoreOrderRepository
|
||||
*/
|
||||
protected $repository;
|
||||
protected $dao;
|
||||
|
||||
/**
|
||||
* StoreOrder constructor.
|
||||
* @param App $app
|
||||
* @param StoreOrderRepository $repository
|
||||
*/
|
||||
public function __construct(App $app, StoreOrderRepository $repository)
|
||||
public function __construct(App $app, StoreOrderRepository $repository,StoreOrderDao $dao)
|
||||
{
|
||||
parent::__construct($app);
|
||||
$this->repository = $repository;
|
||||
$this->dao = $dao;
|
||||
}
|
||||
/**
|
||||
* @return mixed
|
||||
@ -65,12 +68,12 @@ class StoreOrderBehalf extends BaseController
|
||||
public function lst()
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$status = $this->request->param('status',1);
|
||||
// $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');
|
||||
$column = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status', '>=',0)->page($page)->limit($limit)->column('order_id');
|
||||
if ($column) {
|
||||
$where['order_id'] = $column;
|
||||
return app('json')->success($this->repository->getList($where, 1, 100));
|
||||
@ -101,12 +104,12 @@ class StoreOrderBehalf extends BaseController
|
||||
*/
|
||||
public function logisticsCode($id)
|
||||
{
|
||||
$status = $this->request->param('status',1);
|
||||
// $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');
|
||||
$order_id = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status','>=',0)->where('order_id',$order_id)->value('order_id');
|
||||
if ($order_id) {
|
||||
$order = $this->repository->getWhere(['order_id' => $id,'is_del' => 0]);
|
||||
|
||||
@ -115,4 +118,21 @@ class StoreOrderBehalf extends BaseController
|
||||
}
|
||||
return app('json')->fail('信息有误:请联系官方人员');
|
||||
}
|
||||
|
||||
/**代发订单统计
|
||||
* @return mixed
|
||||
* @author xaboy
|
||||
* @day 2020/6/10
|
||||
*/
|
||||
public function number()
|
||||
{
|
||||
$uid = $this->request->userInfo()['uid'];
|
||||
$mer_id = Db::name('store_service')->where('uid', $uid)->where('is_del', 0)->value('mer_id');
|
||||
if ($mer_id) {
|
||||
$noPostage = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status',0)->count();
|
||||
$noDeliver = Db::name('store_order_behalf')->where('mer_id', $mer_id)->where('status',1)->count();
|
||||
|
||||
}
|
||||
return app('json')->success(compact('noDeliver', 'noPostage',));
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ class paySuccess
|
||||
'master_mer_id'=>$order['mer_id'],
|
||||
'mer_id'=>$merchant_two['mer_id'],
|
||||
'order_id'=>$order['order_id'],
|
||||
'status'=>1
|
||||
'status'=>0
|
||||
];
|
||||
Db::name('store_order_behalf')->insert($datas);
|
||||
}
|
||||
|
@ -348,6 +348,7 @@ Route::group('api/', function () {
|
||||
Route::group('behalf_admin', function () {
|
||||
Route::get('/order_list', '/lst');
|
||||
Route::get('/code', '/logisticsCode');
|
||||
Route::get('/number', '/number');
|
||||
})->prefix('api.store.order.StoreOrderBehalf');
|
||||
//管理员申请转账
|
||||
Route::get('admin/:merId/apply', 'api.store.merchant.Merchant/apply');
|
||||
|
Loading…
x
Reference in New Issue
Block a user