小程序接口
This commit is contained in:
parent
247b6196bc
commit
7222c14d62
@ -57,6 +57,7 @@ use AlibabaCloud\Tea\Utils\Utils;
|
|||||||
use Darabonba\OpenApi\Models\Config;
|
use Darabonba\OpenApi\Models\Config;
|
||||||
use AlibabaCloud\SDK\Ocr\V20191230\Models\RecognizeBusinessLicenseRequest;
|
use AlibabaCloud\SDK\Ocr\V20191230\Models\RecognizeBusinessLicenseRequest;
|
||||||
use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;
|
use AlibabaCloud\Tea\Utils\Utils\RuntimeOptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Common
|
* Class Common
|
||||||
* @package app\controller\api
|
* @package app\controller\api
|
||||||
@ -487,12 +488,14 @@ class Common extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//区县数据
|
//区县数据
|
||||||
public function get_area($city_code){
|
public function get_area($city_code)
|
||||||
|
{
|
||||||
$select = Db::name('geo_area')->where('city_code', $city_code)->field('area_id id,area_code code,area_name name')->select();
|
$select = Db::name('geo_area')->where('city_code', $city_code)->field('area_id id,area_code code,area_name name')->select();
|
||||||
return app('json')->success($select);
|
return app('json')->success($select);
|
||||||
}
|
}
|
||||||
//街道 乡镇数据
|
//街道 乡镇数据
|
||||||
public function get_street($area_code){
|
public function get_street($area_code)
|
||||||
|
{
|
||||||
$select = Db::name('geo_street')->where('area_code', $area_code)->field('street_id id,street_code code,street_name name')->select();
|
$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() : [];
|
$arr = $select ? $select->toArray() : [];
|
||||||
foreach ($arr as $k => $item) {
|
foreach ($arr as $k => $item) {
|
||||||
@ -505,18 +508,19 @@ class Common extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
$arr[$k]['pinyin'] = '';
|
$arr[$k]['pinyin'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return app('json')->success($arr);
|
return app('json')->success($arr);
|
||||||
}
|
}
|
||||||
//村数据
|
//村数据
|
||||||
public function get_village($street_code){
|
public function get_village($street_code)
|
||||||
|
{
|
||||||
$select = Db::name('geo_village')->where('street_code', $street_code)->field('village_id id,village_code code,village_name name')->select();
|
$select = Db::name('geo_village')->where('street_code', $street_code)->field('village_id id,village_code code,village_name name')->select();
|
||||||
return app('json')->success($select);
|
return app('json')->success($select);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取云店铺
|
//获取云店铺
|
||||||
public function get_cloud_shop($street_code){
|
public function get_cloud_shop($street_code)
|
||||||
|
{
|
||||||
//更新查询镇级供应链店铺
|
//更新查询镇级供应链店铺
|
||||||
// $typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id');
|
// $typeTownSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownSupplyChain'])->value('mer_type_id');
|
||||||
/*
|
/*
|
||||||
@ -538,7 +542,8 @@ class Common extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询组合数据
|
* 查询组合数据
|
||||||
*/
|
*/
|
||||||
public function system_group_value($name){
|
public function system_group_value($name)
|
||||||
|
{
|
||||||
$group_id = Db::name('system_group')->where('group_key', $name)->value('group_id');
|
$group_id = Db::name('system_group')->where('group_key', $name)->value('group_id');
|
||||||
$data = [];
|
$data = [];
|
||||||
if ($group_id) {
|
if ($group_id) {
|
||||||
@ -549,14 +554,14 @@ class Common extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return app('json')->success($data);
|
return app('json')->success($data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 商户营业执照
|
* 商户营业执照
|
||||||
*/
|
*/
|
||||||
public function merchant_license_identify($image){
|
public function merchant_license_identify($image)
|
||||||
|
{
|
||||||
$config = new Config([
|
$config = new Config([
|
||||||
// 必填,您的 AccessKey ID
|
// 必填,您的 AccessKey ID
|
||||||
"accessKeyId" => 'LTAI5t7mhH3ij2cNWs1zhPmv',
|
"accessKeyId" => 'LTAI5t7mhH3ij2cNWs1zhPmv',
|
||||||
@ -584,15 +589,12 @@ class Common extends BaseController
|
|||||||
$data['type'] = $a['Data']['Type'];
|
$data['type'] = $a['Data']['Type'];
|
||||||
}
|
}
|
||||||
return app('json')->success($data);
|
return app('json')->success($data);
|
||||||
|
} catch (Exception $error) {
|
||||||
}
|
|
||||||
catch (Exception $error) {
|
|
||||||
if (!($error instanceof TeaError)) {
|
if (!($error instanceof TeaError)) {
|
||||||
$error = new TeaError([], $error->getMessage(), $error->getCode(), $error);
|
$error = new TeaError([], $error->getMessage(), $error->getCode(), $error);
|
||||||
}
|
}
|
||||||
$a = Utils::assertAsString($error->message);
|
$a = Utils::assertAsString($error->message);
|
||||||
return app('json')->fail($a);
|
return app('json')->fail($a);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,4 +608,20 @@ class Common extends BaseController
|
|||||||
$data = $repository->getList($where, $page, $limit);
|
$data = $repository->getList($where, $page, $limit);
|
||||||
return app('json')->success($data);
|
return app('json')->success($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序版本
|
||||||
|
*/
|
||||||
|
public function applet()
|
||||||
|
{
|
||||||
|
$group_id = Db::name('system_group')->where('group_key', 'applet')->value('group_id');
|
||||||
|
$list = [];
|
||||||
|
if ($group_id) {
|
||||||
|
$select = Db::name('system_group_data')->where('group_id', $group_id)->field('value')->limit(30)->select();
|
||||||
|
foreach ($select as $key => $value) {
|
||||||
|
$list[] = json_decode($value['value'], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return app('json')->success($list);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ use think\facade\Route;
|
|||||||
|
|
||||||
Route::group('api/', function () {
|
Route::group('api/', function () {
|
||||||
Route::any('test', 'api.Auth/test');
|
Route::any('test', 'api.Auth/test');
|
||||||
|
Route::any('applet', 'api.Common/applet');
|
||||||
Route::get('label_lst', 'api.Common/label_lst');
|
Route::get('label_lst', 'api.Common/label_lst');
|
||||||
Route::any('system_group_value', 'api.Common/system_group_value');
|
Route::any('system_group_value', 'api.Common/system_group_value');
|
||||||
Route::any('demo_ceshi', 'api.Demo/index');
|
Route::any('demo_ceshi', 'api.Demo/index');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user