This commit is contained in:
mkm 2023-11-11 17:28:30 +08:00
parent 1ee3989a76
commit 5038376e2c
3 changed files with 13 additions and 2 deletions

View File

@ -149,13 +149,13 @@ class Statistics extends BaseController
if (!isset($parmas['goods_id']) || $parmas['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.product_id', 'in', explode(',', $parmas['goods_id'])];
$where[] = ['p.is_refund', '=', 0];
$count = Db::name('store_order_product')->alias('p')
->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');
return app('json')->success(['procure_amount' => $count]);
}

View File

@ -16,6 +16,7 @@ use crmeb\basic\BaseController;
use think\exception\HttpResponseException;
use app\validate\admin\StoreCategoryValidate;
use app\common\repositories\store\service\StoreServiceRepository;
use think\facade\Db;
class StoreCategory extends BaseController
{
@ -167,4 +168,13 @@ class StoreCategory extends BaseController
$validate->check($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);
}
}

View File

@ -35,6 +35,7 @@ Route::group('api/', function () {
Route::get('region/goods', 'api.Auth/goodsStatistics');
Route::get('global/config', 'api.Auth/globalConfig');
Route::get('miniapp/version', 'api.Auth/miniAppVersion');
Route::get('category/list_level', 'api.server.StoreCategory/list_level');
Route::resource('upload', 'api.Upload');
Route::post('articleCatch', 'api.Upload/article');
//强制登录