接口修改3
This commit is contained in:
parent
f5f09d083e
commit
aad29c1ac6
app/api/controller
@ -157,21 +157,26 @@ class Census extends BaseController
|
||||
//总人口
|
||||
$num = Db::table('fa_szxc_information_usermsg')->where($where)->count();
|
||||
//成熟周期 [{"name": "白菜", "pic": "http:agaagag.png", "zhouqi": "5周"}]
|
||||
$zhouqi = Db::table('cms_agriculture_products_traceability')
|
||||
$zhouqi = Db::table('cms_agriculture_products')
|
||||
->alias('a')
|
||||
->join(['fa_szxc_planting_type b'],'a.szxc_planting_type_id = b.id')
|
||||
->field('a.cycle,a.szxc_planting_type_id,b.image,b.name')
|
||||
->where('a.status',1)
|
||||
->withAttr('content', function ($value, $data) {
|
||||
if ($data['content'] != '') {
|
||||
$cont = json_decode($data['content'],1);
|
||||
foreach ($cont as $k => $v){
|
||||
$cont[$k]['cjl'] = '昨日成交量提示15%';
|
||||
}
|
||||
return $cont;
|
||||
if ($data['cycle'] != '') {
|
||||
$cont = json_decode($data['cycle'],1);
|
||||
$image = $data['image'];
|
||||
$name = $data['name'];
|
||||
$cont['pic'] = $image;
|
||||
$cont['name'] = $name;
|
||||
$cont['cjl'] = '昨日成交量提示15%';
|
||||
return [$cont];
|
||||
}else{
|
||||
return '';
|
||||
}
|
||||
|
||||
})
|
||||
->where('status',1)->field('content')->select();
|
||||
|
||||
->where('b.image','<>','')
|
||||
->select();
|
||||
// 订单商品总数
|
||||
$need_num = Db::connect('shop')->table('eb_product_order_log')->alias('a')->join('eb_store_order b','a.order_id = b.order_id')->where($where2)->where('a.status',1)->sum('b.total_num');
|
||||
$return['index'] = [
|
||||
|
@ -1131,6 +1131,33 @@ class Statistics extends BaseController
|
||||
$this->apiSuccess('获取成功',$return);
|
||||
}
|
||||
|
||||
//获取图片
|
||||
public function get_num28($area_id=0,$street_id=0,$village_id=0){
|
||||
$where = [];
|
||||
if ($area_id){
|
||||
$where[] = ['area_id', '=', $area_id];
|
||||
}
|
||||
if ($street_id){
|
||||
$where[] = ['street_id', '=', $street_id];
|
||||
}
|
||||
if ($village_id){
|
||||
$where[] = ['village_id', '=', $village_id];
|
||||
}
|
||||
|
||||
$return = [
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_baicai.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_dadou.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_fanqie.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_gaoliang.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_hongshu.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_huluobo.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_qiezi.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_shanyao.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_tudou.png',
|
||||
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_xiaomai.png',
|
||||
];
|
||||
$this->apiSuccess('获取成功',$return);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user