Merge branch 'dev' of https://gitea.lihaink.cn/mkm/multi-store into dev
This commit is contained in:
commit
bb44d88dd1
@ -81,5 +81,21 @@ class UserController extends BaseAdminController
|
|||||||
return $this->success('ok', $res);
|
return $this->success('ok', $res);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//用户领取列表
|
||||||
|
public function userGiftList()
|
||||||
|
{
|
||||||
|
$uid = (new UserValidate())->goCheck('detail');
|
||||||
|
$page_no = (int)$this->request->get('page_no', 1);
|
||||||
|
$page_size = (int)$this->request->get('page_size', 15);
|
||||||
|
$params = $this->request->get();
|
||||||
|
$params['page_no'] = $page_no > 0 ? $page_no : 1;
|
||||||
|
$params['page_size'] = $page_size > 0 ? $page_size : 15;
|
||||||
|
$uid = $uid['id'];
|
||||||
|
$res = UserLogic::giftList($uid,$params);
|
||||||
|
$res['page_no'] = $params['page_no'];
|
||||||
|
$res['page_size'] = $params['page_size'];
|
||||||
|
return $this->success('ok', $res);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -210,7 +210,8 @@ class StoreProductLogic extends BaseLogic
|
|||||||
'batch'=>$params['batch'],'store_name'=>$params['store_name'],
|
'batch'=>$params['batch'],'store_name'=>$params['store_name'],
|
||||||
'manufacturer_information' => $params['manufacturer_information']??'',
|
'manufacturer_information' => $params['manufacturer_information']??'',
|
||||||
'store_info' => $params['store_info']??'','cate_id'=>$params['cate_id'],
|
'store_info' => $params['store_info']??'','cate_id'=>$params['cate_id'],
|
||||||
'top_cate_id'=>$dealCate['top_cate_id'],'two_cate_id'=>$dealCate['two_cate_id']
|
'top_cate_id'=>$dealCate['top_cate_id'],'two_cate_id'=>$dealCate['two_cate_id'],
|
||||||
|
'bar_code'=> $params['bar_code']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
|
@ -20,6 +20,7 @@ use app\common\logic\BaseLogic;
|
|||||||
use app\common\model\finance\CapitalFlow;
|
use app\common\model\finance\CapitalFlow;
|
||||||
use app\common\model\store_finance_flow\StoreFinanceFlow;
|
use app\common\model\store_finance_flow\StoreFinanceFlow;
|
||||||
use app\common\model\store_order\StoreOrder;
|
use app\common\model\store_order\StoreOrder;
|
||||||
|
use app\common\model\store_product_gift\StoreProductGift;
|
||||||
use app\common\model\user\User;
|
use app\common\model\user\User;
|
||||||
use app\common\model\user\UserAddress;
|
use app\common\model\user\UserAddress;
|
||||||
use app\common\model\user\UserRecharge;
|
use app\common\model\user\UserRecharge;
|
||||||
@ -279,4 +280,18 @@ class UserLogic extends BaseLogic
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function giftList($uid,$params)
|
||||||
|
{
|
||||||
|
$query = StoreProductGift::with(['store','user','goodsName'])->where('uid',$uid);
|
||||||
|
$count = $query->count();
|
||||||
|
$list = $query->page($params['page_no'],$params['page_size'])
|
||||||
|
->order('id','desc')
|
||||||
|
->select()->toArray();
|
||||||
|
return [
|
||||||
|
'lists' => $list,
|
||||||
|
'count' => $count
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,9 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
];
|
];
|
||||||
OrderLogic::writeOff($params);
|
OrderLogic::writeOff($params);
|
||||||
}
|
}
|
||||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
if(in_array($order['shipping_type'],[1,2])){
|
||||||
|
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
||||||
|
|
||||||
@ -242,7 +244,9 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
|
|
||||||
|
|
||||||
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
// Redis::send('push-platform-print', ['id' => $order['id']], 60);
|
||||||
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
if(in_array($order['shipping_type'],[1,2])){
|
||||||
|
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//采购款支付后如果有对应的冻结的话就去反对应的log
|
//采购款支付后如果有对应的冻结的话就去反对应的log
|
||||||
|
34
app/common/model/store_product_gift/StoreProductGift.php
Normal file
34
app/common/model/store_product_gift/StoreProductGift.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\store_product_gift;
|
||||||
|
|
||||||
|
use app\common\model\BaseModel;
|
||||||
|
use app\common\model\store_branch_product\StoreBranchProduct;
|
||||||
|
use app\common\model\store_product\StoreProduct;
|
||||||
|
use app\common\model\system_store\SystemStore;
|
||||||
|
use app\common\model\user\User;
|
||||||
|
use think\model\concern\SoftDelete;
|
||||||
|
|
||||||
|
class StoreProductGift extends BaseModel
|
||||||
|
{
|
||||||
|
use SoftDelete;
|
||||||
|
protected $name = 'store_product_gift';
|
||||||
|
protected $deleteTime = 'delete_time';
|
||||||
|
|
||||||
|
public function store()
|
||||||
|
{
|
||||||
|
return $this->hasOne(SystemStore::class, 'id', 'store_id')
|
||||||
|
->bind(['store_name' => 'name', 'store_phone' => 'phone', 'store_detailed_address' => 'detailed_address', 'store_simple_address' => 'address']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->hasOne(User::class, 'id', 'uid')->bind(['nickname', 'avatar', 'mobile']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function goodsName()
|
||||||
|
{
|
||||||
|
return $this->hasOne(StoreProduct::class,'id','product_id')->bind(['goods_name'=>'store_name','image','unit','price']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -69,10 +69,11 @@ class OrderLogic extends BaseLogic
|
|||||||
|
|
||||||
public static function dealFlexiblePrice($where,$start,$end)
|
public static function dealFlexiblePrice($where,$start,$end)
|
||||||
{
|
{
|
||||||
$todayAmount = UserRecharge::where($where)
|
//排除退款
|
||||||
|
$todayAmount = UserRecharge::where($where)->where('status',1)
|
||||||
->whereBetweenTime('create_time', $start, $end)
|
->whereBetweenTime('create_time', $start, $end)
|
||||||
->sum('price');
|
->sum('price');
|
||||||
$pay_price = StoreOrder::where($where)
|
$pay_price = StoreOrder::where($where)->where('refund_status',0)
|
||||||
->whereBetweenTime('create_time', $start, $end)
|
->whereBetweenTime('create_time', $start, $end)
|
||||||
->sum('pay_price');
|
->sum('pay_price');
|
||||||
return bcadd($todayAmount, $pay_price, 2);
|
return bcadd($todayAmount, $pay_price, 2);
|
||||||
|
@ -602,7 +602,7 @@ class WorkbenchLogic extends BaseLogic
|
|||||||
|
|
||||||
//当日营业额的统计
|
//当日营业额的统计
|
||||||
$today = StoreOrder::where(['paid' => YesNoEnum::YES, 'store_id' => $params['store_id']]);
|
$today = StoreOrder::where(['paid' => YesNoEnum::YES, 'store_id' => $params['store_id']]);
|
||||||
$turnover_today = $today
|
$turnover_today = $today->where('refund_status',0)
|
||||||
->whereDay('create_time')
|
->whereDay('create_time')
|
||||||
->sum('pay_price');
|
->sum('pay_price');
|
||||||
//当日利润的统计
|
//当日利润的统计
|
||||||
|
Loading…
x
Reference in New Issue
Block a user