@@ -75,6 +75,10 @@ class StoreProductController | |||
if ($where['store_name']) { | |||
$field = ['image']; | |||
} | |||
$res = $request->user(); | |||
$res = json_decode($res, true); | |||
$test = $res['agent_level'] ?? 0; | |||
$where['test'] = $test; | |||
$list = $this->services->getGoodsList($where, (int)$request->uid()); | |||
return app('json')->successful(get_thumb_water($list, $type, $field)); | |||
} |
@@ -122,6 +122,8 @@ class UserBillController | |||
$routineSpreadBanner = []; | |||
if ($bannerCount) { | |||
foreach ($spreadBanner as $item) { | |||
$item=mb_substr($item,25,68,'utf8'); | |||
$item='http://storepro.vtor.xyz'.$item; | |||
$routineSpreadBanner[] = ['pic' => $item]; | |||
} | |||
} |
@@ -13,7 +13,7 @@ class FakeOrder extends AuthController{ | |||
$store_id=$this->storeId; | |||
$mobile = $this->request->param('mobile'); | |||
if(empty($mobile) || !is_mobile($mobile)){ | |||
return $this->fail('请输入手机号'); | |||
return $this->fail('请输入正确的手机号'); | |||
} | |||
if (!empty($mobile)) { | |||
@@ -24,6 +24,8 @@ class FakeOrder extends AuthController{ | |||
['phone', '=', $mobile], | |||
])->find() ?? []; | |||
return $this->success(['member'=>$user_date]); | |||
}else{ | |||
return $this->fail('请输入正确的手机号'); | |||
} | |||
} |
@@ -251,6 +251,8 @@ class StoreProductDao extends BaseDao | |||
} | |||
})->when(!$page && $limit, function ($query) use ($limit) { | |||
$query->limit($limit); | |||
})->when((isset($where['test'])), function ($query) use ($where) { | |||
$query->where('userlevel = ' . ($where['test'] + 1)); | |||
})->field($field)->select()->toArray(); | |||
} | |||
@@ -67,16 +67,16 @@ class StoreCategoryServices extends BaseServices | |||
public function getList($where) | |||
{ | |||
$list = $this->dao->getList($where); | |||
$count = $this->dao->count($where); | |||
$count = $this->dao->count($where); | |||
if ($list) { | |||
foreach ($list as $key => &$item) { | |||
if (isset($item['children']) && $item['children']) { | |||
$item['children'] = []; | |||
$item['loading'] = false; | |||
$item['_loading'] = false; | |||
} else { | |||
unset($item['children']); | |||
} | |||
if (isset($item['children']) && $item['children']) { | |||
$item['children'] = []; | |||
$item['loading'] = false; | |||
$item['_loading'] = false; | |||
} else { | |||
unset($item['children']); | |||
} | |||
} | |||
} | |||
return compact('list', 'count'); | |||
@@ -119,6 +119,11 @@ class StoreCategoryServices extends BaseServices | |||
$item['disabled'] = true; | |||
} | |||
} | |||
// foreach ($data as $k=>$v) { | |||
// if (!isset($v['children'])) { | |||
// unset($data[$k]); | |||
// } | |||
// } | |||
return $data; | |||
} | |||
@@ -267,6 +272,7 @@ class StoreCategoryServices extends BaseServices | |||
public function getCategory(array $where) | |||
{ | |||
[$page, $limit] = $this->getPageValue(); | |||
return $this->dao->getCategory(); | |||
return $this->dao->getALlByIndex($where, 'id,cate_name,pid,pic', $limit); | |||
if ($limit) { | |||
} else { |
@@ -1218,7 +1218,7 @@ class StoreProductServices extends BaseServices | |||
} | |||
[$page, $limit] = $this->getPageValue(); | |||
$list = $this->dao->getSearchList($where, $page, $limit, ['id,product_type,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,ot_price,spec_type,recommend_image,unit_name,is_vip,vip_price,is_presale_product,is_vip_product,custom_form']); | |||
$list = $this->dao->getSearchList($where, $page, $limit, ['id,product_type,store_name,cate_id,image,IFNULL(sales, 0) + IFNULL(ficti, 0) as sales,price,stock,activity,ot_price,spec_type,recommend_image,unit_name,is_vip,vip_price,is_presale_product,is_vip_product,custom_form,userlevel,coin']); | |||
if ($list) { | |||
/** @var MemberCardServices $memberCardService */ | |||
$memberCardService = app()->make(MemberCardServices::class); |
@@ -1402,9 +1402,52 @@ class UserServices extends BaseServices | |||
$user['user_extract_bank_status'] = (int)($configData['user_extract_bank_status'] ?? 1); | |||
$user['user_extract_wechat_status'] = (int)($configData['user_extract_wechat_status'] ?? 1); | |||
$user['user_extract_alipay_status'] = (int)($configData['user_extract_alipay_status'] ?? 1); | |||
$user['team_count'] = $this->get_teamcount($uid,$user['agent_level']); | |||
$user['upgradable'] = $this->get_upgradable($user['agent_level'],$user['team_count']); | |||
return $user; | |||
} | |||
public function get_teamcount($uid,$agent_level) | |||
{ | |||
$userspread = new \app\model\user\UserSpread(); | |||
$group = $userspread->where('connection_id',$uid)->select()->toArray(); | |||
if($agent_level == 1){ | |||
return count($group); | |||
} | |||
for ($i=2;$i<9;$i++){ | |||
$group = $userspread->where('connection_id','in', $this->get_uids($group))->select()->toArray(); | |||
if($agent_level == $i){ | |||
return count($group); | |||
} | |||
} | |||
} | |||
private function get_uids(array $group){ | |||
$arr = ''; | |||
foreach ($group as $k => $item){ | |||
$arr = $arr.$item['uid'].','; | |||
} | |||
return substr($arr,0,-1); | |||
} | |||
private function get_upgradable(int $agent_level, int $teamount){ | |||
$object_num = pow(3,$agent_level); | |||
if($teamount >=$object_num){ | |||
return true; | |||
}else { | |||
return false; | |||
} | |||
} | |||
/** | |||
* 用户资金统计 | |||
* @param int $uid |
@@ -383,19 +383,22 @@ class Payment extends BaseApplication | |||
if (!isset($opt['pay_price'])) { | |||
throw new PayException('缺少pay_price'); | |||
} | |||
$certPath = $this->config->get('certPath'); | |||
if (!$certPath) { | |||
throw new PayException('请上传支付证书cert'); | |||
} | |||
$keyPath = $this->config->get('keyPath'); | |||
if (!$keyPath) { | |||
throw new PayException('请上传支付证书key'); | |||
} | |||
if (!is_file($certPath)) { | |||
throw new PayException('支付证书cert不存在'); | |||
} | |||
if (!is_file($keyPath)) { | |||
throw new PayException('支付证书key不存在'); | |||
$config = $this->config->all(); | |||
if ($config['pay_m_type'] == 1) { | |||
$certPath = $this->config->get('certPath'); | |||
if (!$certPath) { | |||
throw new PayException('请上传支付证书cert'); | |||
} | |||
$keyPath = $this->config->get('keyPath'); | |||
if (!$keyPath) { | |||
throw new PayException('请上传支付证书key'); | |||
} | |||
if (!is_file($certPath)) { | |||
throw new PayException('支付证书cert不存在'); | |||
} | |||
if (!is_file($keyPath)) { | |||
throw new PayException('支付证书key不存在'); | |||
} | |||
} | |||
$totalFee = floatval(bcmul($opt['pay_price'], 100, 0)); | |||
$refundFee = isset($opt['refund_price']) ? floatval(bcmul($opt['refund_price'], 100, 0)) : null; |
@@ -78,6 +78,10 @@ class OfficialAccountConfig implements ConfigHandlerInterface | |||
return; | |||
} | |||
$this->init = true; | |||
// $this->appId = 'wx1a377b2f601d3450'; | |||
// $this->secret = '292c5c3306b118ab30da6adb80768cde'; | |||
// $this->token = 'xthbj2h3lp0j2cucwum3uttfq0ixd5ta'; | |||
// $this->aesKey = 'CZFT9siZqkLASJRJ9VlAvjIPnCdsWCNBktDYp44otzR'; | |||
$this->appId = $this->appId ?: $this->httpConfig->getConfig('official.appid', ''); | |||
$this->secret = $this->secret ?: $this->httpConfig->getConfig('official.secret', ''); | |||
$this->token = $this->token ?: $this->httpConfig->getConfig('official.token', ''); |
@@ -116,8 +116,10 @@ class PaymentConfig implements ConfigHandlerInterface | |||
'sub_appid' => $this->appId ?: $this->httpConfig->getConfig(DefaultConfig::MINI_APPID, ''), | |||
'sub_mch_id' => $Service_provider['weixin_zhsid'], | |||
'key' => $Service_provider['weixin_api_key'], | |||
'cert_path' => '/www/wwwroot/ruiRoad_pro_v1.0/public/cert/cert.perm', | |||
'key_path' => '/www/wwwroot/ruiRoad_pro_v1.0/public/cert/key.perm', | |||
// 'cert_path' => '/www/wwwroot/ruiRoad_pro_v1.0/cert/cert.perm', | |||
// 'key_path' => '/www/wwwroot/ruiRoad_pro_v1.0/cert/key.perm', | |||
'cert_path' => './public/cert/cert.perm', | |||
'key_path' => './public/cert/key.perm', | |||
'notify_url' => $this->notifyUrl ?: trim($this->httpConfig->getConfig(DefaultConfig::COMMENT_URL)) . DefaultConfig::value('pay.notifyUrl') | |||
]; | |||
$this->payConfig = $payConfig; |