This commit is contained in:
mkm 2024-05-21 09:08:22 +08:00
parent f02ffce416
commit 9d1d309a2f
4 changed files with 11 additions and 7 deletions
app

@ -96,15 +96,17 @@ class OpurchaseclassController extends BaseAdminController
$where['is_push'] = $is_push;
$res = Opurchaseinfo::where($where)->page($page_no, $page_size)->select()
->each(function ($item) {
$item['sys_labels_arr']='';
$find = Goods::where('id', $item['goods'])->with('unitName')->find();
if($find){
$item['goods_name'] = $find['name'];
$item['unit_name'] = $find['unit_name'];
$goodslabel = GoodsLabel::where('id','in',$find['sys_labels'])->column('id,name');
$item['sys_labels_arr'] = $goodslabel;
}
$where = [
'goods_id' => $item['goods'],
'order_id' => $item['pid'],
'is_adopt' => 1
];
$item['nums_count'] = OpurchaseGoodsOffer::where($where)->sum('nums');
});
$data['count'] = Opurchaseinfo::where($where)->count();

@ -22,7 +22,7 @@ class IndexController extends BaseApiController{
if (strpos($token, 'Bearer') === 0){
$token = trim(substr($token, 6));
}
$res=ShopLogic::auth($token);
$res=ShopLogic::auth($token,$jg_register_id);
if(ShopLogic::hasError()||$res==false){
return $this->fail('没有授权信息');
}else{

@ -15,7 +15,6 @@
{
//获取用户余额和绑定银行账户信息
public function amount_account(){
d($this->request->userInfo);
$uid = $this->request->userInfo['user_id'];
$merchant = Merchant::where('uid',$uid)->findOrEmpty();
$supplier = Supplier::where('uid',$uid)->findOrEmpty();

@ -9,7 +9,7 @@ use think\facade\Db;
class ShopLogic extends BaseLogic
{
public static function auth($token)
public static function auth($token,$jg_register_id='')
{
list(, $base64UrlPayload,) = explode('.', $token);
$payload = base64UrlDecode($base64UrlPayload);
@ -26,6 +26,9 @@ class ShopLogic extends BaseLogic
return $userSession['token'];
}
$userInfo = UserTokenService::setToken($user['user_id'], 6);
if($jg_register_id){
Db::name('user_auth_shop')->where('id',$user['id'])->update(['jg_register_id'=>$jg_register_id]);
}
return $userInfo['token'];
}
}