Merge branch 'dev' of https://gitea.lihaink.cn/mkm/shop-php into dev
This commit is contained in:
commit
3598773af9
@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\controller\api\dataview;
|
||||
|
||||
use app\common\model\Company;
|
||||
use app\common\repositories\BaseRepository;
|
||||
use crmeb\basic\BaseController;
|
||||
use think\App;
|
||||
@ -25,12 +26,30 @@ class Logistics extends BaseController
|
||||
// 三轮车列表 从供销系统获取
|
||||
public function vehicleList()
|
||||
{
|
||||
// 请求供销,供销查区域下的公司,在通过公司查三轮车列表
|
||||
$client = new \GuzzleHttp\Client();
|
||||
$getUrl = env('TASK_WORKER_HOST_URL') . '/api/index/vehicleCarList?areaCode='.$this->areaCode.'&streetCode='.$this->streetCode;
|
||||
$response = $client->request('GET', $getUrl);
|
||||
$result = json_decode($response->getBody(), true);
|
||||
$list = $result['data'];
|
||||
// 镇区域码为空,查区县的公司
|
||||
if (empty($this->streetCode)) {
|
||||
$companyList = Db::connect('work_task')->name('company')->where('area', $this->areaCode)->select()->toArray();
|
||||
} else {
|
||||
$companyList = Db::connect('work_task')->name('company')->where('street', $this->streetCode)->select()->toArray();
|
||||
}
|
||||
$companyIds = array_column($companyList, 'id');
|
||||
// 查镇车辆列表
|
||||
$list = Db::connect('work_task')->name('vehicle_rent')
|
||||
->field('company_id, car_id as id, car_license as license')
|
||||
->append(['area_code','street_code'])
|
||||
->whereIn('company_id', $companyIds)
|
||||
->where('status','in','0,1,2')
|
||||
->withAttr('area_code', function ($value, $data){
|
||||
$company = Db::connect('work_task')->name('company')->where('id', $data['company_id'])->find();
|
||||
return $company['area'];
|
||||
})
|
||||
->withAttr('street_code', function ($value, $data){
|
||||
$company = Db::connect('work_task')->name('company')->where('id', $data['company_id'])->find();
|
||||
return $company['street'];
|
||||
})
|
||||
->group('company_id')
|
||||
->select()->toArray();
|
||||
|
||||
$count = count($list);
|
||||
return app('json')->success(compact('count', 'list'));
|
||||
}
|
||||
@ -50,6 +69,9 @@ class Logistics extends BaseController
|
||||
->where('og.street_code', $this->streetCode)
|
||||
->order('o.order_id', 'desc')
|
||||
->find();
|
||||
if (empty($detail)) {
|
||||
return app('json')->success([]);
|
||||
}
|
||||
// 拼接商户的详细地址 area_id street_id village_id
|
||||
$area = Db::name('geo_area')->where('area_code', $detail['area_id'])->find();
|
||||
$city = Db::name('geo_city')->where('city_code', $area['city_code'])->find();
|
||||
|
@ -95,10 +95,8 @@ class Order extends BaseController
|
||||
$currOrderList = $currOrderCountQuery->page($page, $limit)->select()->toArray();
|
||||
|
||||
foreach ($currOrderList as $k => $order) {
|
||||
$getUrl = env('LOGISTICS_HOST_URL') . '/api/courierData?order_sn=' . $order['order_sn'];
|
||||
$response = $client->request('GET', $getUrl);
|
||||
$courierData = json_decode($response->getBody(), true);
|
||||
$currOrderList[$k]['courier'] = $courierData['data']['courier_name'];
|
||||
$courierName = Db::connect('logistics')->name('logistics')->where(['order_sn'=>$order['order_sn']])->value('courier_name');
|
||||
$currOrderList[$k]['courier'] = $courierName;
|
||||
$currOrderList[$k]['status'] = $this->getStatusDesc($order['status']);
|
||||
}
|
||||
|
||||
|
@ -58,11 +58,11 @@ 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){
|
||||
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');
|
||||
@ -70,9 +70,9 @@ class Merchant extends BaseController
|
||||
// $where['category_id']=implode(',',$category_id);
|
||||
// }
|
||||
// }
|
||||
// unset($where['store_category_id']);
|
||||
// }
|
||||
$where['category_id']=$where['store_category_id']??'';
|
||||
$where['category_id'] = $where['merchant_category_id'];
|
||||
unset($where['merchant_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)
|
||||
|
@ -90,6 +90,47 @@ return [
|
||||
// 数据库表前缀
|
||||
'prefix' => env('database2.prefix', ''),
|
||||
|
||||
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
|
||||
'deploy' => 0,
|
||||
// 数据库读写是否分离 主从式有效
|
||||
'rw_separate' => false,
|
||||
// 读写分离后 主服务器数量
|
||||
'master_num' => 1,
|
||||
// 指定从服务器序号
|
||||
'slave_no' => '',
|
||||
// 是否严格检查字段是否存在
|
||||
'fields_strict' => true,
|
||||
// 是否需要断线重连
|
||||
'break_reconnect' => true,
|
||||
// 监听SQL
|
||||
'trigger_sql' => env('app_debug', true),
|
||||
// 开启字段缓存
|
||||
'fields_cache' => false,
|
||||
// 字段缓存路径
|
||||
'schema_cache_path' => app()->getRuntimePath() . 'schema' . DIRECTORY_SEPARATOR,
|
||||
],
|
||||
// 供销系统
|
||||
'work_task' => [
|
||||
// 数据库类型
|
||||
'type' => env('database3.type', 'mysql'),
|
||||
// 服务器地址
|
||||
'hostname' => env('database3.hostname', '127.0.0.1'),
|
||||
// 数据库名
|
||||
'database' => env('database3.database', ''),
|
||||
// 用户名
|
||||
'username' => env('database3.username', 'root'),
|
||||
// 密码
|
||||
'password' => env('database3.password', ''),
|
||||
// 端口
|
||||
'hostport' => env('database3.hostport', '3306'),
|
||||
// 数据库连接参数
|
||||
'params' => [],
|
||||
// 数据库编码默认采用utf8
|
||||
// 'charset' => env('database.charset', 'utf8'),
|
||||
'charset' => 'utf8mb4',
|
||||
// 数据库表前缀
|
||||
'prefix' => env('database3.prefix', ''),
|
||||
|
||||
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
|
||||
'deploy' => 0,
|
||||
// 数据库读写是否分离 主从式有效
|
||||
|
Loading…
x
Reference in New Issue
Block a user