Merge pull request 'dev' (#7) from dev into master

Reviewed-on: #7
This commit is contained in:
mkm 2023-09-13 22:28:36 +08:00
commit c501b14864
246 changed files with 327 additions and 19 deletions

View File

@ -195,6 +195,9 @@ class StoreOrderDao extends BaseDao
->whereOr('user_phone','like',"%{$where['search']}%");
});
})
->when(isset($where['order_search']) && $where['order_search'] !== '', function ($query) use ($where) {
$query->where('order_sn', 'like', '%' . $where['order_search'] . '%')->whereOr('user_phone', $where['order_search']);
})
->when(isset($where['group_order_sn']) && $where['group_order_sn'] !== '', function ($query) use ($where) {
$query->join('StoreGroupOrder GO','StoreOrder.group_order_id = GO.group_order_id')->where('group_order_sn',$where['group_order_sn']);
})

View File

@ -101,7 +101,11 @@ class MerchantIntentionRepository extends BaseRepository
public function updateStatus($id, $data)
{
$create = $data['create_mer'] == 1;
$create = ($data['create_mer'] == 1 || $data['create_mer'] == -1);
$autoCreate = 0;
if ($data['create_mer'] == -1) {
$autoCreate = 1;
}
unset($data['create_mer']);
$intention = $this->search(['mer_intention_id' => $id])->find();
if (!$intention)
@ -135,7 +139,7 @@ class MerchantIntentionRepository extends BaseRepository
'is_margin' => $margin['is_margin'] ?? -1,
'margin' => $margin['margin'] ?? 0,
'uid' => $intention['uid'],
'reg_admin_id' => request()->adminId(),
'reg_admin_id' => $autoCreate ? 0: request()->adminId(),
];
$data['fail_msg'] = '';
$smsData = [
@ -154,13 +158,13 @@ class MerchantIntentionRepository extends BaseRepository
'site' => systemConfig('site_name'),
];
}
Db::transaction(function () use ($config, $intention, $data, $create,$margin,$merData,$smsData) {
Db::transaction(function () use ($config, $intention, $data, $create,$margin,$merData,$smsData,$autoCreate) {
if ($data['status'] == 1) {
if ($create) {
$merchant = app()->make(MerchantRepository::class)->createMerchant($merData);
$data['mer_id'] = $merchant->mer_id;
$data['uid'] = $intention['uid'];
$data['reg_admin_id'] = $merchant['merchant_admin']['merchant_admin_id'];
$data['reg_admin_id'] = $autoCreate ? 0: $merchant['merchant_admin']['merchant_admin_id'];
// 写入商户客服表
$store_service_data['mer_id'] = $merchant->mer_id;
$store_service_data['uid'] = $intention['uid'];

View File

@ -23,6 +23,7 @@ use app\common\repositories\user\UserSignRepository;
use app\common\repositories\wechat\RoutineQrcodeRepository;
use app\common\repositories\wechat\WechatUserRepository;
use app\common\repositories\system\RelevanceRepository;
use app\common\repositories\system\merchant\MerchantIntentionRepository;
use app\validate\api\ChangePasswordValidate;
use app\validate\api\UserAuthValidate;
use crmeb\basic\BaseController;
@ -1310,6 +1311,20 @@ class Auth extends BaseController
//获取app版本更新信息
public function appVersion()
{
$brandArray = [
'huawei',
'honor',
'iphone',
'samsung',
'xiaomi',
'redmi',
'mi',
'oppo',
'vivo',
'nokia',
'meizu',
'moto'
];
$type = $this->request->param('type', '-1');
$version = $this->request->param('version', '');
$phoneBrand = $this->request->param('phone_brand', '');
@ -1323,11 +1338,31 @@ class Auth extends BaseController
$queryBuilder = $queryBuilder->where('version', '>', $version);
}
if ($phoneBrand) {
$queryBuilder = $queryBuilder->where('phone_brand', $phoneBrand);
foreach($brandArray as $b) {
$pos = stripos($phoneBrand, $b);
if ($pos !== false) {
$queryBuilder = $queryBuilder->where('phone_brand', $b);
}
}
}
$appInfo = ($queryBuilder->order('id', 'desc')->find()) ?? (object)[];
$appInfo = ($queryBuilder->order('id', 'desc')->fetchSql(false)->find()) ?? (object)[];
}
return app('json')->success(compact('appInfo'));
}
//同步商户状态信息
public function merchantStatus($id)
{
Log::info("接收到同步商户状态HOST" . request()->url());
$repository = app()->make(MerchantIntentionRepository::class);
if (!$repository->getWhereCount(['mer_intention_id' => $id, 'is_del' => 0]))
return app('json')->fail('数据不存在');
$param = $this->request->params(['status']);
$data['status'] = $param['status'];
$data['create_mer'] = -1;
$data['fail_msg'] = $param['status'] == 1 ? '自动审核通过' : '自动审核拒绝';
$repository->updateStatus($id, $data);
return app('json')->success('同步成功');
}
}

View File

@ -76,6 +76,7 @@ class StoreOrder extends BaseController
}
$where['is_verify'] = $this->request->param('is_verify');
$where['search'] = $this->request->param('store_name');
$where['order_search'] = $this->request->param('search_info');
$where['mer_id'] = $merId;
$where['is_del'] = 0;
return app('json')->success($repository->merchantGetList($where, $page, $limit));

View File

@ -22,6 +22,7 @@ use crmeb\services\SwooleTaskService;
use crmeb\services\YunxinSmsService;
use think\App;
use think\facade\Db;
use think\facade\Log;
use crmeb\basic\BaseController;
use app\common\repositories\system\merchant\MerchantIntentionRepository as repository;
use think\exception\ValidateException;
@ -45,13 +46,9 @@ class MerchantIntention extends BaseController
return app('json')->fail('未开启商户入驻');
}
if ($this->userInfo) $data['uid'] = $this->userInfo->uid;
$newUid = Db::name('User')->where('account', $data['phone'])->value('uid', -1);
if ($newUid != -1 && $this->userInfo->uid != $newUid) {
//throw new ValidateException('该申请手机已存在账户,不可申请');
}
$newMerid = Db::name('Merchant')->where('mer_phone', $data['phone'])->value('mer_id', -1);
if ($newMerid != -1) {
//throw new ValidateException('该申请手机已存在商户,不可申请');
$merInfo = Db::name('merchant')->where('uid', $this->userInfo->uid)->where('status', 1)->find();
if ($merInfo) {
throw new ValidateException('该用户已存在商户,不可申请');
}
$make = app()->make(MerchantRepository::class);
if ($make->fieldExists('mer_name', $data['mer_name']))
@ -70,9 +67,56 @@ class MerchantIntention extends BaseController
'id' => $intention->mer_intention_id
]
]);
$areaInfo = Db::name('geo_area')->where('area_code', $data['area_id'] ?? '')->find();
$cityId = Db::name('geo_city')->where('city_code', $areaInfo['city_code'] ?? '')->value('city_id', 0);
$streetId = Db::name('geo_street')->where('street_code', $data['street_id'] ?? '')->value('street_id', 0);
$sendData = [
'company_name' => $data['mer_name'],
'organization_code' => $data['social_credit_code'] ?? '',
'master_name' => $data['name'],
'master_phone' => $data['phone'],
'city' => $cityId,
'area' => $areaInfo['area_id'] ?? 0,
'street' => $streetId,
'mer_intention_id' => $intention->mer_intention_id
];
$res = $this->sendMerIntentionApply($sendData);
if (!$res) {
Db::name('merchant_intention')->where('mer_intention_id', $intention->mer_intention_id)->delete();
throw new ValidateException('申请商户入驻任务失败,请联系平台');
}
// $cdata['status'] = 1;
// $cdata['create_mer'] = -1;
// $cdata['fail_msg'] ='自动审核通过';
// $this->repository->updateStatus($intention->mer_intention_id, $cdata);
return app('json')->success('提交成功');
}
//发送商户入驻申请
public function sendMerIntentionApply($data)
{
$postUrl = env('TASK_WORKER_HOST_URL') . '/adminapi/company/createShopMerchant';
Log::info("商户入驻申请HOST: {$postUrl}");
Log::info("发送商户入驻申请信息: " . json_encode($data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $postUrl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$resData = curl_exec($ch);
curl_close($ch);
$ok = false;
if (!empty($resData) && is_string($resData)) {
Log::info("商户入驻申请反馈信息" . $resData);
$resInfo = json_decode($resData, true);
if(!empty($resInfo['code']) && $resInfo['code'] == 1){
$ok = true;
}
}
return $ok;
}
public function update($id)
{
if (!$this->repository->getWhere(['mer_intention_id' => (int)$id, 'uid' => $this->userInfo->uid, 'is_del' => 0]))
@ -126,6 +170,7 @@ class MerchantIntention extends BaseController
'images',
'merchant_category_id',
'mer_type_id',
'social_credit_code',
'area_id',
'street_id',
'village_id',

View File

@ -1 +0,0 @@
.my-cion[data-v-bd303882]{display:inline-block}.icon[data-v-bd303882]{width:16px;height:16px}a[data-v-116e78c8]{text-decoration:none;color:inherit}.content[data-v-116e78c8]{overflow:hidden;background-color:#f49a2b;position:relative;width:100vw;height:100vh}.content .bg[data-v-116e78c8]{position:absolute;top:0;left:0;z-index:1;width:100vw;height:100vh;background-color:#f49a2b}.content .download[data-v-116e78c8]{position:absolute;top:60vh;left:0;z-index:100;width:100vw;height:6.25rem;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-weight:700}.content .download .btn[data-v-116e78c8]{width:10.9375rem;height:2.5rem;line-height:2.5rem;background-color:#fc902e;text-align:center;color:#fff;border-radius:.25rem;box-shadow:inset 0 0 5px 1px rgba(0,0,0,.1)}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.my-cion[data-v-bd303882]{display:inline-block}.icon[data-v-bd303882]{width:16px;height:16px}a[data-v-d4a8b3ad]{text-decoration:none;color:inherit}.content[data-v-d4a8b3ad]{overflow:hidden;background-color:#f49a2b;position:relative;width:100vw;height:100vh}.content .bg[data-v-d4a8b3ad]{position:absolute;top:0;left:0;z-index:1;width:100vw;height:100vh;background-color:#f49a2b}.content .download[data-v-d4a8b3ad]{position:absolute;top:60vh;left:0;z-index:100;width:100vw;height:6.25rem;display:flex;flex-direction:column;justify-content:space-between;align-items:center;font-weight:700}.content .download .btn[data-v-d4a8b3ad]{width:10.9375rem;height:2.5rem;line-height:2.5rem;background-color:#fc902e;text-align:center;color:#fff;border-radius:.25rem;box-shadow:inset 0 0 5px 1px rgba(0,0,0,.1)}.content .tip[data-v-d4a8b3ad]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10000}.content .tip uni-image[data-v-d4a8b3ad]{width:100%;height:100%}.content .tip .close[data-v-d4a8b3ad]{position:absolute;top:65vh;left:50%;transform:translate(-50%);width:9.375rem;height:5rem}

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
import{o as s,c as t,w as a,a as e,b as o,d as c,i as n,r as i,s as l,e as d,f as r,g as f,h as p,j as u}from"./index-4d0c217c.js";const h=""+new URL("bg-1998f5fb.jpg",import.meta.url).href,w=(s,t)=>{const a=s.__vccOpts||s;for(const[e,o]of t)a[e]=o;return a},v=w({__name:"my_icon",props:["type"],setup(i){const l=i;return(i,d)=>{const r=n;return s(),t(r,{class:"my-cion"},{default:a((()=>["ios"!=l.type?(s(),e("svg",{key:0,t:"1694421309742",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1505",width:"200",height:"200"},[o("path",{d:"M911.020879 320.237361c-36.202548 0-66.192962 28.664228-66.192962 63.470791V630.54159c0 34.806563 28.966692 63.494057 66.192962 63.494057 36.179281 0 66.169695-28.687495 66.169695-63.517323V383.731418c-1.023722-34.806563-29.990414-63.470791-66.169695-63.47079z m-798.317365 0C76.547499 320.237361 46.533818 348.901589 46.533818 383.684885V630.54159c0 34.806563 28.943425 63.494057 66.169696 63.494057 37.22627 0 66.192962-28.687495 66.192961-63.517323V383.731418c0-34.806563-28.966692-63.470791-66.192961-63.47079z m106.513665 2.047445v451.601191c0 26.616783 22.754558 49.138677 51.697983 49.138677h58.957106v137.225338c0 34.829829 28.943425 63.494057 66.169695 63.494057 36.202548 0 66.192962-28.664228 66.192962-63.494057v-137.225338h103.395965v137.225338c0 34.829829 28.966692 63.494057 66.192962 63.494057C667.979867 1023.744069 697.993547 995.079841 697.993547 960.250012v-137.225338h58.933839c28.966692 0 51.721249-21.498171 51.72125-49.138677V322.26154H219.217179zM651.46071 88.783026L706.276393 15.051744c2.047445-5.118612 2.047445-11.260947-3.117701-13.308391-4.141423-3.071167-10.33029-1.023722-13.44799 3.071167l-55.839405 76.802449A363.142266 363.142266 0 0 0 511.862196 60.118798c-43.438404 0-84.78283 7.166057-122.009101 21.498171l-55.839405-76.779183c-3.1177-5.118612-9.306568-6.165601-13.44799-3.094433a9.655564 9.655564 0 0 0-2.093978 13.308391l54.815683 73.754548c-85.806553 37.87773-146.811103 109.561567-154.070226 193.530073h588.407734c-9.306568-83.991772-69.310662-155.652342-156.164203-193.553339zM387.782384 205.533916c-18.613135 0-32.061125-13.308392-32.061125-30.711673 0-17.426548 14.471713-30.711673 32.061125-30.711673 18.613135 0 32.037859 13.285125 32.037859 30.711673 0 17.403281-14.471713 30.711673-32.037859 30.711673z m252.301047 0c-18.613135 0-32.061125-13.308392-32.061125-30.711673 0-17.426548 14.494979-30.711673 32.061125-30.711673 18.613135 0 32.061125 13.285125 32.061125 30.711673 0 17.403281-14.471713 30.711673-32.061125 30.711673z",fill:"#ffffff","p-id":"1506"})])):c("",!0),"ios"==l.type?(s(),e("svg",{key:1,t:"1694421562754",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2747",width:"200",height:"200"},[o("path",{d:"M791.488 544.095c-1.28-129.695 105.76-191.871 110.528-194.975-60.16-88.032-153.856-100.064-187.232-101.472-79.744-8.064-155.584 46.944-196.064 46.944-40.352 0-102.816-45.76-168.96-44.544-86.912 1.28-167.072 50.528-211.808 128.384-90.304 156.703-23.136 388.831 64.896 515.935 43.008 62.208 94.304 132.064 161.632 129.568 64.832-2.592 89.376-41.952 167.744-41.952s100.416 41.952 169.056 40.672c69.76-1.312 113.984-63.392 156.704-125.792 49.376-72.16 69.728-142.048 70.912-145.632-1.536-0.704-136.064-52.224-137.408-207.136zM662.56 163.52C698.304 120.16 722.432 60 715.84 0c-51.488 2.112-113.888 34.304-150.816 77.536-33.152 38.368-62.144 99.616-54.368 158.432 57.472 4.48 116.128-29.216 151.904-72.448z","p-id":"2748",fill:"#ffffff"})])):c("",!0)])),_:1})}}},[["__scopeId","data-v-bd303882"]]),_={};["options","get","post","put","head","delete","trace","connect"].forEach((s=>{_[s]=(t,a,e)=>((s,t,a,{noAuth:e=!1})=>new Promise(((e,o)=>{i({url:"/api"+s,method:t||"GET",data:"GET"!=t&&a||{},params:"GET"==t?a:{},success:s=>{e(s.data)},fail:s=>{l({title:"网络错误",icon:"none"}),o("请求失败")}})})))(t,s,a,e||{})}));const m=w({__name:"index",setup(e){const c=d({}),i=d({});(async()=>{let s=await _.get("/app/version?type=3");200==s.status&&(c.value=s.data.android,i.value=s.data.ios)})();const w=()=>{"ios"==p().platform?window.location.href=i.value.dow_url:l({icon:"none",title:"您不是IOS设备"})};return(e,i)=>{const l=u,d=n;return s(),t(d,{class:"content"},{default:a((()=>[r(l,{src:h,class:"bg"}),r(d,{class:"download"},{default:a((()=>[o("a",{href:c.value.dow_url,download:"huinongshenghuo.apk"},[r(d,{class:"btn"},{default:a((()=>[r(v),f(" Android下载 ")])),_:1})],8,["href"]),r(d,{class:"btn",onClick:w},{default:a((()=>[r(v,{type:"ios"}),f(" IOS下载 ")])),_:1})])),_:1})])),_:1})}}},[["__scopeId","data-v-116e78c8"]]);export{m as default};

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

View File

@ -14,7 +14,7 @@
<title>惠农生活</title>
<!--preload-links-->
<!--app-context-->
<script type="module" crossorigin src="./assets/index-4d0c217c.js"></script>
<script type="module" crossorigin src="./assets/index-b1675540.js"></script>
<link rel="stylesheet" href="./assets/index-44297b41.css">
</head>
<body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

View File

@ -2,4 +2,4 @@
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
if(window.location.protocol == 'https:'){
document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">')
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.a6fc2aaa.js></script></body></html>
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.6ec4a737.js></script></body></html>

View File

@ -2,4 +2,4 @@
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
if(window.location.protocol == 'https:'){
document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">')
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.f121f2d3.js></script></body></html>
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.bcecaf67.js></script></body></html>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 MiB

After

Width:  |  Height:  |  Size: 528 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1010 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More