作者 jinglong
1 个管道 的构建 通过 耗费 22 秒

增加总公司logo

... ... @@ -691,7 +691,7 @@ class CommonController extends RestBaseController
public function getUserById($where){
$res = Db::name('user')
->where($where)
->field('id,user_login,identity')
->field('id,user_login,identity,create_time')
->find();
return $res;
}
... ...
... ... @@ -76,7 +76,7 @@ class IndexController extends RestBaseController
* @param name:project_id type:int require:0 default: other desc:项目id
*
* @return data: @
* @data id:公司id company_name:甲方公司名称 logo:公司logo company_name_head:甲方总公司名称 address:地区 run_time:运行时间 service:服务列表@
* @data id:公司id company_name:总公司名称 logo:总公司logo address:地区 run_time:运行时间 service:服务列表@
* @service id:服务id(1:日检,2:月检,3:改造,4:维修,5:培训,6:演习,7:年检,100:使用说明) name:服务名称 icon:图标路径 english_name:英文名称
* @return tips:提示语
*/
... ... @@ -84,15 +84,13 @@ class IndexController extends RestBaseController
if($this->request->isGet()){
$project_id = $this->request->get('project_id');
$field = 'id,company_name,company_name_head,address,logo,create_time';
$field = 'id,company_name_head company_name,address,head_logo logo,u_ls_id';
$common = new CommonController();
//查询甲方公司id
$company = $common->getCompanyAid($project_id);
$res = $common->getTotalCompany(['id'=>$company['a_cid']],$field);
$host = config('site.host');
foreach($res as &$value){
//查找企业拥有的服务
$data['c_id'] = $value['id'];
... ... @@ -104,8 +102,9 @@ class IndexController extends RestBaseController
}
}
$value['logo'] = $host.'/upload/'.$value['logo'];
//公司运行时间
$value['run_time'] = $common->getRunTime($value['create_time']);
//总公司运行时间
$time = $common->getUserById(['id'=>$value['u_ls_id']]);
$value['run_time'] = $common->getRunTime($time['create_time']);
}
$arr['data'] = $res;
$arr['tips'] = config('site.tips');
... ...
... ... @@ -279,6 +279,7 @@ class AdminProjectController extends AdminBaseController
$company_a['company_name'] = $data['company_name'];//甲方公司名称
if($data['is_children'] == 1){
$company_a['company_name_head'] = $data['company_name_head'];//甲方总公司名称
$company_a['head_logo'] = $data['head_logo'];//总公司logo
//$company_a['address'] = $data['address'];//地区
}
$company_a['u_s_id'] = $u_s_id;//甲方员工uid
... ... @@ -439,6 +440,7 @@ class AdminProjectController extends AdminBaseController
$company_a['license'] = $data['license'];
if($data['is_children'] == 1){
$company_a['company_name_head'] = $data['company_name_head'];//甲方总公司名称
$company_a['head_logo'] = $data['head_logo'];//总公司logo
//$company_a['address'] = $data['address'];//地区
//查询该总领导是否存在
$res = $common->getIsMobile($data['mobile2']);
... ...
... ... @@ -114,6 +114,20 @@
<input class="form-control" type="text" name="company_name_head" placeholder="请输入总公司名称"/>
</td>
</tr>
<tr class="address company_address">
<th>总公司logo</th>
<td>
<div>
<input type="hidden" name="head_logo" id="head_logo" value="">
<a href="javascript:uploadOneImage('图片上传','#head_logo');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="head_logo-preview"
width="100" style="cursor: pointer"/>
</a>
<input type="button" class="btn btn-sm btn-cancel-head_logo" value="取消图片">
</div>
</td>
</tr>
<!--<tr class="address company_address">-->
<!--<th>企业地区</th>-->
<!--<td>-->
... ... @@ -267,6 +281,11 @@
$('#logo-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#logo').val('');
});
//甲方总公司logo
$('.btn-cancel-head_logo').click(function () {
$('#head_logo-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#head_logo').val('');
});
//甲方营业执照
$('.btn-cancel-license').click(function () {
$('#license-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
... ...
... ... @@ -124,6 +124,26 @@
<input class="form-control" type="text" name="company_name_head" placeholder="请输入总公司名称" value="{$post.part_a.company_name_head}"/>
</td>
</tr>
<tr class="address company_address">
<th>总公司logo</th>
<td>
<div style="text-align: left;">
<input type="hidden" name="head_logo" id="head_logo" value="{$post.part_a.head_logo|default=''}">
<a href="javascript:uploadOneImage('图片上传','#head_logo');">
<if condition="empty($post.part_a.head_logo)">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="head_logo-preview"
width="100" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_preview_url($post.part_a.head_logo)}"
id="head_logo-preview"
width="100" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-head_logo" value="取消图片">
</div>
</td>
</tr>
<!--<tr class="address company_address">-->
<!--<th>企业地区</th>-->
<!--<td>-->
... ... @@ -375,6 +395,11 @@
$('#logo-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#logo').val('');
});
//总公司甲方logo
$('.btn-cancel-head_logo').click(function () {
$('#head_logo-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#head_logo').val('');
});
//甲方营业执照
$('.btn-cancel-license').click(function () {
$('#license-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
... ...