更新
This commit is contained in:
parent
1ee3989a76
commit
5038376e2c
@ -149,13 +149,13 @@ class Statistics extends BaseController
|
|||||||
if (!isset($parmas['goods_id']) || $parmas['goods_id'] == '') {
|
if (!isset($parmas['goods_id']) || $parmas['goods_id'] == '') {
|
||||||
return app('json')->fail('goods_id:格式错误');
|
return app('json')->fail('goods_id:格式错误');
|
||||||
}
|
}
|
||||||
|
$mer_id=Db::name('merchant_intention')->where('mer_intention_id', $parmas['mer_intention_id'])->value('mer_id');
|
||||||
$where[] = ['p.create_time', 'between time', [date("Y-m-d H:i:s", $parmas['start_time']), date("Y-m-d H:i:s", $parmas['end_time'])]];
|
$where[] = ['p.create_time', 'between time', [date("Y-m-d H:i:s", $parmas['start_time']), date("Y-m-d H:i:s", $parmas['end_time'])]];
|
||||||
$where[] = ['p.product_id', 'in', explode(',', $parmas['goods_id'])];
|
$where[] = ['p.product_id', 'in', explode(',', $parmas['goods_id'])];
|
||||||
$where[] = ['p.is_refund', '=', 0];
|
$where[] = ['p.is_refund', '=', 0];
|
||||||
$count = Db::name('store_order_product')->alias('p')
|
$count = Db::name('store_order_product')->alias('p')
|
||||||
->where($where)
|
->where($where)
|
||||||
->join('store_order o', 'o.mer_id=' . $parmas['mer_intention_id'] . ' and o.paid=1 and o.is_del=0')
|
->join('store_order o', 'o.mer_id=' . $mer_id . ' and o.paid=1 and o.is_del=0')
|
||||||
->sum('p.total_price');
|
->sum('p.total_price');
|
||||||
return app('json')->success(['procure_amount' => $count]);
|
return app('json')->success(['procure_amount' => $count]);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ use crmeb\basic\BaseController;
|
|||||||
use think\exception\HttpResponseException;
|
use think\exception\HttpResponseException;
|
||||||
use app\validate\admin\StoreCategoryValidate;
|
use app\validate\admin\StoreCategoryValidate;
|
||||||
use app\common\repositories\store\service\StoreServiceRepository;
|
use app\common\repositories\store\service\StoreServiceRepository;
|
||||||
|
use think\facade\Db;
|
||||||
|
|
||||||
class StoreCategory extends BaseController
|
class StoreCategory extends BaseController
|
||||||
{
|
{
|
||||||
@ -167,4 +168,13 @@ class StoreCategory extends BaseController
|
|||||||
$validate->check($data);
|
$validate->check($data);
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分类
|
||||||
|
*/
|
||||||
|
public function list_level($pid=0,$level=0){
|
||||||
|
$select= Db::name('store_category')->where('pid',$pid)->where('level',$level)->where('is_show',1)->where('mer_id',0)->select();
|
||||||
|
return app('json')->success($select);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ Route::group('api/', function () {
|
|||||||
Route::get('region/goods', 'api.Auth/goodsStatistics');
|
Route::get('region/goods', 'api.Auth/goodsStatistics');
|
||||||
Route::get('global/config', 'api.Auth/globalConfig');
|
Route::get('global/config', 'api.Auth/globalConfig');
|
||||||
Route::get('miniapp/version', 'api.Auth/miniAppVersion');
|
Route::get('miniapp/version', 'api.Auth/miniAppVersion');
|
||||||
|
Route::get('category/list_level', 'api.server.StoreCategory/list_level');
|
||||||
Route::resource('upload', 'api.Upload');
|
Route::resource('upload', 'api.Upload');
|
||||||
Route::post('articleCatch', 'api.Upload/article');
|
Route::post('articleCatch', 'api.Upload/article');
|
||||||
//强制登录
|
//强制登录
|
||||||
|
Loading…
x
Reference in New Issue
Block a user