Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
5bbc214663
0
app/controller/api/dataview/Logistics.php
Normal file → Executable file
0
app/controller/api/dataview/Logistics.php
Normal file → Executable file
0
app/controller/api/dataview/Order.php
Normal file → Executable file
0
app/controller/api/dataview/Order.php
Normal file → Executable file
30
app/controller/api/store/merchant/Merchant.php
Normal file → Executable file
30
app/controller/api/store/merchant/Merchant.php
Normal file → Executable file
@ -58,21 +58,21 @@ class Merchant extends BaseController
|
||||
public function lst()
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$where = $this->request->params(['store_category_id','keyword', 'order', 'is_best', 'location', 'category_id', 'type_id', 'type_code', 'is_trader', 'street_id', 'credit_buy']);
|
||||
$where = $this->request->params(['merchant_category_id', 'keyword', 'order', 'is_best', 'location', 'category_id', 'type_id', 'type_code', 'is_trader', 'street_id', 'credit_buy']);
|
||||
if (empty($where['type_id'])) {
|
||||
$where['type_id'] = [10, 17];
|
||||
}
|
||||
if($where['store_category_id']>0){
|
||||
$arr= Db::name('store_category')->where(['pid'=>$where['store_category_id'],'mer_id'=>0,'level'=>1,'is_show'=>1])->column('cate_name');
|
||||
if($arr){
|
||||
$category_id=Db::name('merchant_category')->whereIn('category_name',$arr)->column('merchant_category_id');
|
||||
if($category_id){
|
||||
$where['category_id']=implode(',',$category_id);
|
||||
if ($where['merchant_category_id'] > 0) {
|
||||
// $arr= Db::name('store_category')->where(['pid'=>$where['store_category_id'],'mer_id'=>0,'level'=>1,'is_show'=>1])->column('cate_name');
|
||||
// if($arr){
|
||||
// $category_id=Db::name('merchant_category')->whereIn('category_name',$arr)->column('merchant_category_id');
|
||||
// if($category_id){
|
||||
// $where['category_id']=implode(',',$category_id);
|
||||
// }
|
||||
// }
|
||||
$where['category_id'] = $where['merchant_category_id'];
|
||||
unset($where['merchant_category_id']);
|
||||
}
|
||||
}
|
||||
unset($where['store_category_id']);
|
||||
}
|
||||
// $where['category_id']=$where['store_category_id']??'';
|
||||
return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo));
|
||||
}
|
||||
|
||||
@ -154,8 +154,7 @@ class Merchant extends BaseController
|
||||
]);
|
||||
$url = $info['dir'];
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$url = $this->repository->wxQrcode(intval($id));
|
||||
}
|
||||
return app('json')->success(compact('url'));
|
||||
@ -243,7 +242,6 @@ class Merchant extends BaseController
|
||||
}
|
||||
|
||||
$data['delivery_way'] = $delivery_way;
|
||||
|
||||
} else {
|
||||
$data = $this->request->params(['mer_state']);
|
||||
|
||||
@ -309,7 +307,8 @@ class Merchant extends BaseController
|
||||
return app('json')->success($merchantInfo);
|
||||
}
|
||||
|
||||
public function apply($merId){
|
||||
public function apply($merId)
|
||||
{
|
||||
$merchant = app()->make(MerchantRepository::class)->search(['mer_id' => $merId])->field('uid,mer_id,mer_name,mer_money,financial_bank,financial_wechat,financial_alipay,financial_type')->find();
|
||||
if (($msg = $this->checkAuth($merchant)) !== true) {
|
||||
return app('json')->fail($msg);
|
||||
@ -374,7 +373,6 @@ class Merchant extends BaseController
|
||||
$where['mer_id'] = $merId;
|
||||
$data = app()->make(FinancialRepository::class)->getAdminList($where, $page, $limit);
|
||||
return app('json')->success($data);
|
||||
|
||||
}
|
||||
|
||||
public function account($merId)
|
||||
|
@ -5,6 +5,7 @@ use crmeb\basic\BaseController;
|
||||
use think\App;
|
||||
use think\facade\Db;
|
||||
use app\common\repositories\system\merchant\MerchantRepository;
|
||||
use Overtrue\Pinyin\Pinyin;
|
||||
|
||||
/**
|
||||
* Class Auth
|
||||
@ -29,6 +30,25 @@ class Merchant extends BaseController
|
||||
return app('json')->success($select);
|
||||
}
|
||||
|
||||
public function get_street(){
|
||||
$area_code = $this->request->param('area_code', '');
|
||||
$select=Db::name('geo_street')->where('area_code',$area_code)->field('street_id id,street_code code,street_name name')->select();
|
||||
$arr=$select?$select->toArray():[];
|
||||
foreach ($arr as $k=>$item){
|
||||
$first_char = mb_str_split($item['name']);
|
||||
if($first_char[0]){
|
||||
$pinyin=new Pinyin();
|
||||
$string=$first_char[0];
|
||||
$pinyin = $pinyin->abbr($string);
|
||||
$arr[$k]['pinyin']=$pinyin;
|
||||
}else{
|
||||
$arr[$k]['pinyin']='';
|
||||
}
|
||||
|
||||
}
|
||||
return app('json')->success($arr);
|
||||
}
|
||||
|
||||
public function count()
|
||||
{
|
||||
$where = $this->request->params(['keyword', 'date', 'status', 'statusTag', 'is_trader', 'category_id', 'type_id']);
|
||||
|
@ -25,6 +25,7 @@ Route::group('middle/', function () {
|
||||
Route::any('user/lst', 'middle.User/lst');
|
||||
|
||||
Route::any('merchant/city/get_area', 'middle.Merchant/get_area');
|
||||
Route::any('merchant/city/get_street', 'middle.Merchant/get_street');
|
||||
Route::any('merchant/count', 'middle.Merchant/count');
|
||||
Route::any('merchant/category/options', 'middle.MerchantCategory/getOptions');
|
||||
Route::any('merchant/type/options', 'middle.MerchantType/options');
|
||||
|
Loading…
x
Reference in New Issue
Block a user