Compare commits
5 Commits
20250724-0
...
20250804-0
| Author | SHA1 | Date | |
|---|---|---|---|
| ae0d0d83ac | |||
| a1668b60fc | |||
| 356b80a653 | |||
| b8f583bcc7 | |||
| 2f1c7a9b28 |
@@ -41,7 +41,7 @@ class DriverService extends BaseService
|
||||
|
||||
$list = $this->siteDriverStatementModel
|
||||
->when($searchCityId, function ($query) use ($searchCityId) {
|
||||
$query->whereIn('city_id', $searchCityId);
|
||||
$query->where('city_id', $searchCityId);
|
||||
})
|
||||
->when($searchDriverId, function ($query) use ($searchDriverId) {
|
||||
$query->where('driver_id', $searchDriverId);
|
||||
|
||||
@@ -41,7 +41,7 @@ class SiteService extends BaseService
|
||||
|
||||
$list = $this->siteDriverStatementModel
|
||||
->when($searchCityId, function ($query) use ($searchCityId) {
|
||||
$query->whereIn('city_id', $searchCityId);
|
||||
$query->where('city_id', $searchCityId);
|
||||
})
|
||||
->when($searchSiteId, function ($query) use ($searchSiteId) {
|
||||
$query->where('site_id', $searchSiteId);
|
||||
|
||||
@@ -61,7 +61,7 @@ class EmployeeService extends BaseService
|
||||
/**
|
||||
* @var array|string[]
|
||||
*/
|
||||
private array $filed = ['id','username','avatar','chinese_name','mobile','status','last_login_ip','last_login_time','role_id'];
|
||||
private array $filed = ['id','username','avatar','chinese_name','mobile','status','last_login_ip','last_login_time','role_id','bind_user_id'];
|
||||
|
||||
/**
|
||||
* 列表
|
||||
@@ -160,8 +160,8 @@ class EmployeeService extends BaseService
|
||||
|
||||
$bindUserId = (int)$this->request->input('bind_user_id', 0);
|
||||
if ($bindUserId > 0) {
|
||||
$oldBindUserId = $this->adminUserModel->getAdminInfoByBindUserId($bindUserId);
|
||||
if (!empty($oldBindUserId) && $info->bind_user_id != $oldBindUserId) throw new ErrException('绑定用户已存在');
|
||||
$oldInfo = $this->adminUserModel->getAdminInfoByBindUserId($bindUserId);
|
||||
if (!empty($oldBindUserId) && $info->bind_user_id != $oldInfo->bind_user_id) throw new ErrException('绑定用户已存在');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ use App\Constants\ConfigCode;
|
||||
use App\Exception\ErrException;
|
||||
use App\Model\Category;
|
||||
use App\Service\Api\BaseService;
|
||||
use App\Service\ServiceTrait\Api\BannerTrait;
|
||||
use App\Service\ServiceTrait\Common\CycleTrait;
|
||||
use App\Service\ServiceTrait\Common\OssTrait;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
@@ -30,6 +31,7 @@ use function Hyperf\Config\config;
|
||||
class OptionalListService extends BaseService
|
||||
{
|
||||
use CycleTrait;
|
||||
use BannerTrait;
|
||||
|
||||
/**
|
||||
* @var GoodCache
|
||||
@@ -86,7 +88,7 @@ class OptionalListService extends BaseService
|
||||
|
||||
$res = $this->buildData($data);
|
||||
|
||||
return $this->return->success('success', ['list' => $res]);
|
||||
return $this->return->success('success', ['list' => $res,'banner' => $this->getBanner((int)$this->request->input('city_id',config('system.default_city_id')))]);
|
||||
}
|
||||
|
||||
use OssTrait;
|
||||
|
||||
@@ -34,7 +34,7 @@ class IndexService extends BaseService
|
||||
$avatar = $this->getOssObjectById($userInfo->avatar_id);
|
||||
|
||||
$res = [
|
||||
'banner' => $this->getBanner(),
|
||||
// 'banner' => $this->getBanner(),
|
||||
'nickname' => $userInfo->nickname,
|
||||
'avatar' => $avatar,
|
||||
'point' => 0,
|
||||
|
||||
41
app/Service/ServiceTrait/Api/BannerTrait.php
Normal file
41
app/Service/ServiceTrait/Api/BannerTrait.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Service\ServiceTrait\Api;
|
||||
|
||||
use App\Constants\Common\BannerCode;
|
||||
use App\Model\Banner;
|
||||
use App\Service\ServiceTrait\Common\OssTrait;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
|
||||
trait BannerTrait
|
||||
{
|
||||
use OssTrait;
|
||||
|
||||
/**
|
||||
* @var Banner
|
||||
*/
|
||||
#[Inject]
|
||||
protected Banner $bannerModel;
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function getBanner(int $cityId): array
|
||||
{
|
||||
$res = $this->bannerModel
|
||||
->where('city_id',$cityId)
|
||||
->where('status',BannerCode::DISPLAYED)
|
||||
->orderBy('sort')
|
||||
->get();
|
||||
if ($res->isEmpty()) return [];
|
||||
$res = $res->toArray();
|
||||
|
||||
$imageList = $this->getOssObjects(array_column($res, 'image_id'));
|
||||
|
||||
foreach ($res as &$v) {
|
||||
$v['url'] = $imageList[$v['image_id']]['url'] ?? '';
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
@@ -30,5 +30,7 @@ return [
|
||||
// upload_dir
|
||||
'upload_dir' => BASE_PATH.'/uploads/',
|
||||
// 默认的厨房 id
|
||||
'default_kitchen_id' => env('DEFAULT_KITCHEN_ID',''),
|
||||
'default_kitchen_id' => env('DEFAULT_KITCHEN_ID',1),
|
||||
// 默认 城市 id
|
||||
'default_city_id' => env('DEFAULT_CITY_ID',3),
|
||||
];
|
||||
@@ -60,5 +60,5 @@ WX_PAYMENT_MCH_SECRET_KEY=075cf77f5b57cc84ba59e9df3b86eda1
|
||||
WX_PAYMENT_MCH_SECRET_CERT=__DIR__/config/pay/wx/apiclient_key.pem
|
||||
WX_PAYMENT_MCH_PUBLIC_CERT_PATH=__DIR__/config/pay/wx/apiclient_cert.pem
|
||||
WX_PAYMENT_MINI_APP_ID=wx444b711b6101f25b
|
||||
WX_PAYMENT_SUB_MINI_APP_ID=wxc2bc0e47e212d831
|
||||
WX_PAYMENT_SUB_MCH_ID=1656142874
|
||||
WX_PAYMENT_SUB_MINI_APP_ID=wxc0edbbd0ff0fe7ed
|
||||
WX_PAYMENT_SUB_MCH_ID=1723727305
|
||||
@@ -55,5 +55,5 @@ WX_PAYMENT_MCH_SECRET_KEY=075cf77f5b57cc84ba59e9df3b86eda1
|
||||
WX_PAYMENT_MCH_SECRET_CERT=__DIR__/config/pay/wx/apiclient_key.pem
|
||||
WX_PAYMENT_MCH_PUBLIC_CERT_PATH=__DIR__/config/pay/wx/apiclient_cert.pem
|
||||
WX_PAYMENT_MINI_APP_ID=wx444b711b6101f25b
|
||||
WX_PAYMENT_SUB_MINI_APP_ID=wxc2bc0e47e212d831
|
||||
WX_PAYMENT_SUB_MCH_ID=1656142874
|
||||
WX_PAYMENT_SUB_MINI_APP_ID=wxc0edbbd0ff0fe7ed
|
||||
WX_PAYMENT_SUB_MCH_ID=1723727305
|
||||
4
env.pre
4
env.pre
@@ -58,5 +58,5 @@ WX_PAYMENT_MCH_SECRET_KEY=075cf77f5b57cc84ba59e9df3b86eda1
|
||||
WX_PAYMENT_MCH_SECRET_CERT=__DIR__/config/pay/wx/apiclient_key.pem
|
||||
WX_PAYMENT_MCH_PUBLIC_CERT_PATH=__DIR__/config/pay/wx/apiclient_cert.pem
|
||||
WX_PAYMENT_MINI_APP_ID=wx444b711b6101f25b
|
||||
WX_PAYMENT_SUB_MINI_APP_ID=wxc2bc0e47e212d831
|
||||
WX_PAYMENT_SUB_MCH_ID=1656142874
|
||||
WX_PAYMENT_SUB_MINI_APP_ID=wxc0edbbd0ff0fe7ed
|
||||
WX_PAYMENT_SUB_MCH_ID=1723727305
|
||||
4
env.prod
4
env.prod
@@ -58,5 +58,5 @@ WX_PAYMENT_MCH_SECRET_KEY=075cf77f5b57cc84ba59e9df3b86eda1
|
||||
WX_PAYMENT_MCH_SECRET_CERT=__DIR__/config/pay/wx/apiclient_key.pem
|
||||
WX_PAYMENT_MCH_PUBLIC_CERT_PATH=__DIR__/config/pay/wx/apiclient_cert.pem
|
||||
WX_PAYMENT_MINI_APP_ID=wx444b711b6101f25b
|
||||
WX_PAYMENT_SUB_MINI_APP_ID=wxc2bc0e47e212d831
|
||||
WX_PAYMENT_SUB_MCH_ID=1656142874
|
||||
WX_PAYMENT_SUB_MINI_APP_ID=wxc0edbbd0ff0fe7ed
|
||||
WX_PAYMENT_SUB_MCH_ID=1723727305
|
||||
Reference in New Issue
Block a user