远程更新

This commit is contained in:
mkm 2023-08-07 09:36:32 +08:00
parent 3ec1a3cb00
commit df6ca826c0
17 changed files with 535 additions and 53 deletions

View File

@ -6,7 +6,7 @@ use think\facade\Db;
class CommonController extends BaseAdminController
{
public array $notNeedLogin = ['city', 'area', 'street'];
public array $notNeedLogin = ['city', 'area', 'street','village','brigade'];
//**省列表 */
public function province()
@ -31,4 +31,16 @@ class CommonController extends BaseAdminController
$data = Db::name('geo_street')->where(['area_code' => $street])->select();
return $this->data($data->toArray());
}
//**村列表 */
public function village($village)
{
$data = Db::name('geo_village')->where(['street_code' => $village])->select();
return $this->data($data->toArray());
}
//**小队列表 */
public function brigade()
{
$data = Db::name('geo_brigade')->select();
return $this->data($data->toArray());
}
}

View File

@ -58,10 +58,8 @@ class CompanyController extends BaseAdminController
$params = (new CompanyValidate())->post()->goCheck('add');
$params['other_contacts'] = json_encode($params['other_contacts']);
$params['qualification'] = json_encode($params['qualification']);
$params['area_manager']=$this->adminId;
$result = CompanyLogic::add($params);
if ($this->adminInfo['root'] != 1 && empty($params['contract']['party_a'])) {
return $this->fail('签约方不能为空');
}
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
@ -80,9 +78,6 @@ class CompanyController extends BaseAdminController
$params = (new CompanyValidate())->post()->goCheck('edit');
$params['other_contacts'] = json_encode($params['other_contacts']);
$params['qualification'] = json_encode($params['qualification']);
if ($this->adminInfo['root'] != 1 && empty($params['contract']['party_a'])) {
return $this->fail('签约方不能为空');
}
$result = CompanyLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);

View File

@ -0,0 +1,109 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\controller\task_template;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\task_template\TaskTemplateLists;
use app\common\logic\task_template\TaskTemplateLogic;
use app\adminapi\validate\task_template\TaskTemplateValidate;
/**
* 任务模板控制器
* Class TaskTemplateController
* @package app\adminapi\controller\task_template
*/
class TaskTemplateController extends BaseAdminController
{
/**
* @notes 获取任务模板列表
* @return \think\response\Json
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function lists()
{
return $this->dataLists(new TaskTemplateLists());
}
/**
* @notes 添加任务模板
* @return \think\response\Json
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function add()
{
$params = (new TaskTemplateValidate())->post()->goCheck('add');
$params['admin_id'] = $this->adminId;
$result = TaskTemplateLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(TaskTemplateLogic::getError());
}
/**
* @notes 编辑任务模板
* @return \think\response\Json
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function edit()
{
$params = (new TaskTemplateValidate())->post()->goCheck('edit');
$result = TaskTemplateLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(TaskTemplateLogic::getError());
}
/**
* @notes 删除任务模板
* @return \think\response\Json
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function delete()
{
$params = (new TaskTemplateValidate())->post()->goCheck('delete');
TaskTemplateLogic::delete($params);
return $this->success('删除成功', [], 1, 1);
}
/**
* @notes 获取任务模板详情
* @return \think\response\Json
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function detail()
{
$params = (new TaskTemplateValidate())->goCheck('detail');
$result = TaskTemplateLogic::detail($params);
return $this->data($result);
}
}

View File

@ -0,0 +1,77 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\lists\task_template;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\task_template\TaskTemplate;
use app\common\lists\ListsSearchInterface;
/**
* 任务模板列表
* Class TaskTemplateLists
* @package app\adminapi\liststask_template
*/
class TaskTemplateLists extends BaseAdminDataLists implements ListsSearchInterface
{
/**
* @notes 设置搜索条件
* @return \string[][]
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function setSearch(): array
{
return [
'=' => ['title', 'admin_id', 'moeny', 'type', 'status', 'content'],
];
}
/**
* @notes 获取任务模板列表
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function lists(): array
{
return TaskTemplate::where($this->searchWhere)
->field(['id', 'title', 'admin_id', 'moeny', 'type', 'status', 'content'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->toArray();
}
/**
* @notes 获取任务模板数量
* @return int
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function count(): int
{
return TaskTemplate::where($this->searchWhere)->count();
}
}

View File

@ -54,12 +54,17 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface
public function lists(): array
{
$where = [];
if(isset($this->params['company_id']) && $this->params['company_id'] != ''){
if(isset($this->params['company_id']) && $this->params['company_id'] > 0){
$where[] = ['company_id', '=', $this->params['company_id']];
}else{
if($this->adminInfo['root']!=1){
$company_id=Db::name('company')->where('admin_id',$this->adminInfo['admin_id'])->value('id');
$where[]=['company_id','=',$company_id];
if($this->adminInfo['role_id'][0]==8){
$where[]=['area_manager','=',$this->adminInfo['admin_id']];
}else{
$company_id=Db::name('company')->where('admin_id',$this->adminInfo['admin_id'])->value('id');
$where[]=['company_id','=',$company_id];
}
}
}
$field = "id,sn,nickname,sex,avatar,account,mobile,channel,create_time,admin_id,company_id,street,street as street_name,is_contract";

View File

@ -21,7 +21,9 @@ use app\common\model\auth\Admin;
use app\common\model\contract\Contract;
use app\common\model\user\User;
use think\exception\ValidateException;
use think\facade\Config;
use think\facade\Db;
use app\common\service\FileService;
/**
@ -42,6 +44,7 @@ class CompanyLogic extends BaseLogic
*/
public static function add(array $params): bool
{
unset($params['id']);
Db::startTrans();
try {
// $exist = Company::where('admin_id', $params['admin_id'])->find();
@ -49,9 +52,7 @@ class CompanyLogic extends BaseLogic
// throw new ValidateException('该账号已经注册过企业');
// }
$level_one = $params['contract']['party_a'] ?? 0;
$data = Company::create([
// 'level_two' => $params['level_two'],
// 'level_one' => $params['level_one'],
$arr=[
'company_name' => $params['company_name'],
'organization_code' => $params['organization_code'],
'province' => $params['province'],
@ -66,19 +67,37 @@ class CompanyLogic extends BaseLogic
'master_email' => $params['master_email'],
'other_contacts' => $params['other_contacts'],
'area_manager' => $params['area_manager'] ?? 0,
// 'is_contract' => $params['is_contract'],
// 'account' => $params['account'],
// 'password' => $params['password'],
// 'deposit' => $params['deposit'],
// 'deposit_time' => $params['deposit_time'],
'qualification' => $params['qualification'],
'admin_id' => $params['admin_id'] ?? 0,
'level_one' => $level_one,
// 'status' => $params['status']
]);
if ($level_one > 0) {
$contractId = self::contract($data['id'], $params);
}
];
$data = Company::create($arr);
$passwordSalt = Config::get('project.unique_identification');
$defaultAvatar = config('project.default_image.admin_avatar');
$admin=$arr;
$admin['id_card']=$params['id_card'];
$admin['area_manager']=$params['area_manager'];
$admin['sex']=$params['sex'];
$admin['name']=$params['master_name'];
$admin['account']=$params['master_phone'];
$admin['avatar'] = !empty($params['avatar']) ? FileService::setFileUrl($params['avatar']) : $defaultAvatar;
$admin['phone']=$params['master_phone'];
$admin['password'] = create_password(123456, $passwordSalt);
$admin_id=Admin::strict(false)->insertGetId($admin);
$userSn = User::createUserSn();
$admin['admin_id']=$admin_id;
$admin['sn']=$userSn;
$admin['sechannel']=4;
$admin['company_id']=$data['id'];
$admin['real_name']=$params['master_name'];
$admin['nickname']=$params['master_name'];
$admin['mobile']=$params['master_phone'];
$admin['phone']=$params['master_phone'];
User::strict(false)->insert($admin);
// if ($level_one > 0) {
// $contractId = self::contract($data['id'], $params);
// }
Db::commit();
return true;
} catch (\Exception $e) {

View File

@ -365,6 +365,7 @@ class AdminLogic extends BaseLogic
public static function createUser($admin, $password, $adminId)
{
$user = User::where(['admin_id' => $adminId])->find();
unset($admin['id'],$admin['contract']);
if (empty($user)) {
$userSn = User::createUserSn();
User::create([
@ -376,22 +377,20 @@ class AdminLogic extends BaseLogic
'channel' => 3,
'admin_id' => $adminId,
'qualification'=>$admin['qualification'],
'province'=>$admin['province'],
'city'=>$admin['city'],
'area'=>$admin['area'],
'street'=>$admin['street'],
'address'=>$admin['address'],
]);
} else {
if(isset($admin['avatar']) && $admin['avatar']!=''){
$user->avatar = $admin['avatar'];
}
if(isset($admin['name']) && $admin['name']!=''){
$user->nickname = $admin['name'];
}
if(isset($admin['disable']) && $admin['disable']!=''){
$user->is_disable = $admin['disable'];
}
if(isset($admin['qualification']) && $admin['qualification']!=''){
$user->qualification = $admin['qualification'];
}
$user->admin_id=$adminId;
$user->save();
$user->save($admin);
}
}

View File

@ -0,0 +1,100 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\adminapi\validate\task_template;
use app\common\validate\BaseValidate;
/**
* 任务模板验证器
* Class TaskTemplateValidate
* @package app\adminapi\validate\task_template
*/
class TaskTemplateValidate extends BaseValidate
{
/**
* 设置校验规则
* @var string[]
*/
protected $rule = [
'id' => 'require',
'title' => 'require',
'type' => 'require',
'status' => 'require',
];
/**
* 参数描述
* @var string[]
*/
protected $field = [
'id' => 'id',
'title' => '主题',
'type' => '任务类型',
'status' => '状态',
];
/**
* @notes 添加场景
* @return TaskTemplateValidate
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function sceneAdd()
{
return $this->only(['title','type','status']);
}
/**
* @notes 编辑场景
* @return TaskTemplateValidate
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function sceneEdit()
{
return $this->only(['id','title','type','status']);
}
/**
* @notes 删除场景
* @return TaskTemplateValidate
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function sceneDelete()
{
return $this->only(['id']);
}
/**
* @notes 详情场景
* @return TaskTemplateValidate
* @author likeadmin
* @date 2023/08/06 17:30
*/
public function sceneDetail()
{
return $this->only(['id']);
}
}

View File

@ -64,8 +64,8 @@ class CompanyController extends BaseApiController
$company['qualification'] = $company['qualification'] != null ? json_decode($company['qualification'], true) : '';
$contract = Contract::where('party_b',$id)->find();
if (!empty($contract)) {
if ($contract['admin_id'] != 0) {
$contract['party_b_name'] = Admin::where('id', $contract['admin_id'])->value('name');
if ($contract['type'] == 2) {
$contract['party_b_name'] = User::where('id', $contract['party_b'])->value('nickname');
} else {
$contract['party_b_name'] = Db::name('company')->where('id', $contract['party_b'])->value('company_name');
}
@ -130,8 +130,9 @@ class CompanyController extends BaseApiController
$query = User::where('id', $id);
$user = $query->with(['company' => function ($query) {
$query->field('id,company_name');
}])->append(['province_name', 'city_name', 'area_name', 'street_name'])->field('id,sex,avatar,nickname name,account,mobile phone,id_card,qualification,province,city,area,street,is_contract,company_id,is_captain')->find()->toArray();
$contract = Contract::whereRaw("(type=1 and party_b={$user['company_id']}) or (type=2 and party_b={$user['id']})")->append(['contract_type_name'])->find();
}])->field('id,sex,avatar,nickname name,account,mobile phone,id_card,qualification,province,province province_name,city,city city_name,area,area area_name,street,street street_name,village,village village_name,brigade,brigade brigade_name, is_contract,company_id,is_captain')->find()->toArray();
$contract = Contract::where("type",2)->where('party_b',$id)->append(['contract_type_name'])->find();
$user['contract'] = $contract;
// $roleIds = AdminRole::where('admin_id', $user['id'])->column('role_id');
// $user['roles'] = SystemRole::whereIn('id', $roleIds)->column('name');

View File

@ -5,6 +5,7 @@ namespace app\api\controller;
use app\common\model\auth\Admin;
use app\common\model\Company;
use app\common\model\contract\Contract;
use app\common\model\user\User;
use think\facade\Db;
/**
@ -18,14 +19,10 @@ class ContractController extends BaseApiController
public function index()
{
[$page, $limit] = $this->getPage();
$admin = Admin::where('id', $this->userInfo['admin_id'])->find();
if (empty($admin)) {
return $this->success();
}
if (!empty($admin['company_id'])) {
$query = Contract::whereRaw("(type=1 and party_b={$admin['company_id']}) or (type=2 and party_b={$admin['id']})");
if($this->userInfo['admin_id']==0){
$query = Contract::where("type",2)->where('party_b',$this->userId);
} else {
$query = Contract::where('party_b', $admin['id']);
$query = Contract::where("type",1)->where('party_b',$this->userInfo['company_id']);
}
$count = $query->count();
$contract = $query->page($page)->limit($limit)->select()->each(function ($item, $key) {
@ -53,7 +50,7 @@ class ContractController extends BaseApiController
return $this->fail('合同不存在');
}
if ($contract['type'] == 2) {
$contract['party_b_name'] = Admin::where('id', $contract['party_b'])->value('name');
$contract['party_b_name'] = User::where('id', $contract['party_b'])->value('nickname');
} else {
$contract['party_b_name'] = Db::name('company')->where('id', $contract['party_b'])->value('company_name');
}

View File

@ -154,6 +154,7 @@ class JunziqianController extends BaseApiController
$request->fileType = 1; //合同上传方式 url
$request->url = $data['url'];
$request->notifyUrl = 'https://worker-task.lihaink.cn/notify_url?id=' . $id;
$request->needQifengSign = 1;
//发起PING请求
// halt($request);
$response = $requestUtils->doPost("/v2/sign/applySign", $request);
@ -189,7 +190,7 @@ class JunziqianController extends BaseApiController
}
//html模板
public function html_contract($data,$id)
public function html_contract($data, $id)
{
$requestUtils = new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
//CURLFile 可以传url或filePath但必须保证文件存在且有效否则php不会报错只会导致http请求返回null并没有调到服务端
@ -201,6 +202,7 @@ class JunziqianController extends BaseApiController
$request->fileType = 3;
$request->htmlContent = $data['content'];
$request->notifyUrl = 'https://worker-task.lihaink.cn/notify_url?id=' . $id;
$request->needQifengSign = 1;
//发起PING请求
$response = $requestUtils->doPost("/v2/sign/applySign", $request);
@ -210,9 +212,9 @@ class JunziqianController extends BaseApiController
public function download_file($applyNo)
{
$requestUtils = new RequestUtils($this->serviceUrl, $this->appkey, $this->appSecret);
$find=Db::name('contract')->where('contract_no',$applyNo)->value('contract_url');
if($find){
return $this->success('获取成功', ['url' => 'https://worker-task.lihaink.cn'.$find]);
$find = Db::name('contract')->where('contract_no', $applyNo)->value('contract_url');
if ($find) {
return $this->success('获取成功', ['url' => 'https://worker-task.lihaink.cn' . $find]);
}
//初始化请求参数
$request = array(

View File

@ -24,6 +24,7 @@ use app\common\{enum\notice\NoticeEnum,
service\sms\SmsDriver,
service\wechat\WeChatMnpService
};
use app\common\model\dict\DictData;
use app\common\model\user\UserAccountLog;
use think\db\exception\DataNotFoundException;
use think\exception\ValidateException;
@ -75,10 +76,13 @@ class UserLogic extends BaseLogic
public static function info(int $userId)
{
$user = User::where(['id' => $userId])->with(['company'])
->field('id,sn,sex,account,password,nickname,real_name,avatar,mobile,create_time,user_money,income,admin_id,company_id,is_captain')
->field('id,sn,sex,account,password,nickname,real_name,avatar,mobile,create_time,user_money,income,admin_id,company_id,is_captain,province,province province_name,city,city city_name,area,area area_name,street,street street_name,village,village village_name,brigade,brigade brigade_name')
->findOrEmpty();
// $user['avatar'] = $user['avatar'] ? Request()->host() . $user['avatar'] : $user['avatar'];
$user['day_money_count']=UserAccountLog::where(['user_id'=>$userId,'action'=>1])->whereDay('create_time')->sum('change_amount');
if(isset($user['company']['company_type'])){
$user['company']['company_type_name']=DictData::where(['id'=>$user['company']['company_type']])->value('name');
}
$user['has_password'] = !empty($user['password']);
$user['has_auth'] = self::hasWechatAuth($userId);
$user['version'] = config('project.version');

View File

@ -0,0 +1,116 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\logic\task_template;
use app\common\model\task_template\TaskTemplate;
use app\common\logic\BaseLogic;
use think\facade\Db;
/**
* 任务模板逻辑
* Class TaskTemplateLogic
* @package app\adminapi\logic\task_template
*/
class TaskTemplateLogic extends BaseLogic
{
/**
* @notes 添加任务模板
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/08/06 17:30
*/
public static function add(array $params): bool
{
Db::startTrans();
try {
TaskTemplate::create([
'title' => $params['title'],
'admin_id' => $params['admin_id'],
'moeny' => $params['moeny'],
'type' => $params['type'],
'status' => $params['status'],
'content' => $params['content']
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 编辑任务模板
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/08/06 17:30
*/
public static function edit(array $params): bool
{
Db::startTrans();
try {
TaskTemplate::where('id', $params['id'])->update([
'title' => $params['title'],
'admin_id' => $params['admin_id'],
'moeny' => $params['moeny'],
'type' => $params['type'],
'status' => $params['status'],
'content' => $params['content']
]);
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
/**
* @notes 删除任务模板
* @param array $params
* @return bool
* @author likeadmin
* @date 2023/08/06 17:30
*/
public static function delete(array $params): bool
{
return TaskTemplate::destroy($params['id']);
}
/**
* @notes 获取任务模板详情
* @param $params
* @return array
* @author likeadmin
* @date 2023/08/06 17:30
*/
public static function detail($params): array
{
return TaskTemplate::findOrEmpty($params['id'])->toArray();
}
}

View File

@ -55,9 +55,9 @@ class UserInformationg extends BaseModel
Db::startTrans();
try {
$result = self::create($data);
foreach ($param['datas'] as $k => $v) {
self::informationg_demand($v, $result['id'], $param['admin_id']);
}
// foreach ($param['datas'] as $k => $v) {
// self::informationg_demand($v, $result['id'], $param['admin_id']);
// }
// switch($param['data_type']){
// case 1:
// self::informationg_demand($param,$result['id']);

View File

@ -0,0 +1,34 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\task_template;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* 任务模板模型
* Class TaskTemplate
* @package app\common\model\task_template
*/
class TaskTemplate extends BaseModel
{
use SoftDelete;
protected $name = 'task_template';
protected $deleteTime = 'delete_time';
}

View File

@ -182,7 +182,11 @@ class User extends BaseModel
public function company()
{
return $this->hasOne(Company::class, 'id', 'company_id')->field(['id','company_name','admin_id']);
return $this->hasOne(Company::class, 'id', 'company_id')->field(['id','company_name','admin_id','company_type']);
}
public function getProvinceNameAttr($value)
{
return Db::name('geo_province')->where(['province_code' => $this->province])->value('province_name');
}
public function getCityNameAttr($value)
{
@ -198,4 +202,12 @@ class User extends BaseModel
{
return Db::name('geo_street')->where(['street_code' => $this->street])->value('street_name');
}
public function getVillageNameAttr($value)
{
return Db::name('geo_village')->where(['village_code' => $this->village])->value('village_name');
}
public function getBrigadeNameAttr($value)
{
return Db::name('geo_brigade')->where(['id' => $this->brigade])->value('brigade_name');
}
}

@ -1 +1 @@
Subproject commit 9acc82cd23d807280ddd29df2117e7890094d049
Subproject commit 1294ea49ff9ecc4532821f8798304816cbf8dd74