483 lines
22 KiB
PHP
483 lines
22 KiB
PHP
<?php
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
require_once APPPATH . 'controllers/api/BaseController.php';
|
|
|
|
/**
|
|
* Notes:私域直播_活动管理
|
|
* Created on: 2022/9/19 17:15
|
|
* Created by: dengbw
|
|
*/
|
|
class Activity extends BaseController
|
|
{
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->load->model('market/Market_sylive_activity_model', 'mdSyliveActivity');
|
|
$this->load->model('market/Market_sylive_activity_biz_model', 'mdSyliveActivityBiz');
|
|
$this->load->model('market/Market_sylive_organization_model', 'mdSyliveOrganization');
|
|
}
|
|
|
|
/**
|
|
* Notes:活动管理列表
|
|
* Created on: 2022/9/20 14:48
|
|
* Created by: dengbw
|
|
*/
|
|
public function page_get()
|
|
{
|
|
$page = $this->input_param('page');
|
|
$limit = $this->input_param('limit');
|
|
$title = $this->input_param('title');
|
|
$sort = $this->input_param('sort');
|
|
$order = $this->input_param('order');
|
|
!$page && $page = 1;
|
|
!$limit && $limit = 10;
|
|
$sort_order = 'activityId desc';
|
|
if ($sort && $order) {
|
|
$sort_order = $sort . ' ' . $order;
|
|
}
|
|
$list = [];
|
|
$where['status>='] = 0;
|
|
$title && $where['title LIKE "%' . trim($title) . '%"'] = null;
|
|
$count = $this->mdSyliveActivity->count($where);
|
|
if ($count) {
|
|
$this->load->library('MyEncryption');
|
|
$res = $this->mdSyliveActivity->select($where, $sort_order, $page, $limit);
|
|
foreach ($res as $v) {
|
|
$dateRange = [$v['timeStart'], $v['timeEnd']];
|
|
$status = intval($v['status']);
|
|
$activityId = intval($v['activityId']);
|
|
$bgImg = $channelImg = $shareImg = $shareTitle = $bizIds = [];
|
|
$item = ['activityId' => $activityId, 'itemImg' => [], 'title' => '', 'introduction' => '', 'price' => '', 'dateRange' => ''];
|
|
$v['shareTitle'] && $shareTitle = json_decode($v['shareTitle'], true);
|
|
$jsondata = $v['jsondata'] ? json_decode($v['jsondata'], true) : [];
|
|
if ($jsondata['item']) {
|
|
$getItem = $jsondata['item'];
|
|
$item['title'] = $getItem['title'];
|
|
$item['introduction'] = $getItem['introduction'];
|
|
$item['price'] = $getItem['price'];
|
|
$item['dateRange'] = [$getItem['timeStart'], $getItem['timeEnd']];
|
|
if ($getItem['itemImg']) {
|
|
$itemImg = [];
|
|
foreach ($getItem['itemImg'] as $k2 => $v2) {
|
|
$itemImg[] = ['uid' => $k2, 'fileUrl' => $v2, 'url' => build_qiniu_image_url($v2), 'status' => 'done'];
|
|
}
|
|
$item['itemImg'] = $itemImg;
|
|
}
|
|
}
|
|
if ($v['bgImg']) {
|
|
$bgImg = [['uid' => 1, 'fileUrl' => $v['bgImg'], 'url' => build_qiniu_image_url($v['bgImg']), 'status' => 'done']];
|
|
}
|
|
if ($v['channelImg']) {
|
|
$channelImg = [['uid' => 1, 'fileUrl' => $v['channelImg'], 'url' => build_qiniu_image_url($v['channelImg']), 'status' => 'done']];
|
|
}
|
|
if ($v['shareImg']) {
|
|
$getShareImg = json_decode($v['shareImg'], true);
|
|
foreach ($getShareImg as $k2 => $v2) {
|
|
$shareImg[] = ['uid' => $k2, 'fileUrl' => $v2, 'url' => build_qiniu_image_url($v2), 'status' => 'done'];
|
|
}
|
|
}
|
|
$res_biz = $this->mdSyliveActivityBiz->select(['activityId' => $activityId, 'status' => 0], 'id desc', 0, 0, 'bizId');
|
|
if ($res_biz) {
|
|
foreach ($res_biz as $k2 => $v2) {
|
|
$bizIds[] = intval($v2['bizId']);
|
|
}
|
|
}
|
|
$url = http_host_com('home') . "/h5/market/sylive?skey=" . $this->myencryption->base64url_encode("id=" . $activityId);
|
|
$list[] = [
|
|
'activityId' => $activityId, 'title' => $v['title'], 'channelId' => $v['channelId'], 'bizIds' => $bizIds,
|
|
'introduction' => $v['introduction'], 'shareTitle' => $shareTitle, 'dateRange' => $dateRange
|
|
, 'bgImg' => $bgImg, 'channelImg' => $channelImg, 'shareImg' => $shareImg, 'item' => $item, 'url' => $url
|
|
, 's_time' => $v['timeStart'], 'e_time' => $v['timeEnd'], 'status' => $status, 'createTime' => $v['createTime']];
|
|
}
|
|
}
|
|
$date = ['list' => $list, 'count' => $count];
|
|
$this->return_response_list($date);
|
|
}
|
|
|
|
/**
|
|
* Notes:添加活动
|
|
* Created on: 2022/9/21 16:46
|
|
* Created by: dengbw
|
|
*/
|
|
public function index_post()
|
|
{
|
|
$title = $this->input_param('title');
|
|
$channelId = $this->input_param('channelId');
|
|
$dateRange = $this->input_param('dateRange');
|
|
$introduction = $this->input_param('introduction');
|
|
$shareTitle = $this->input_param('shareTitle');
|
|
$shareImg = $this->input_param('shareImg');
|
|
$bgImg = $this->input_param('bgImg');
|
|
$channelImg = $this->input_param('channelImg');
|
|
$bizIds = $this->input_param('bizIds');
|
|
if (!$title) {
|
|
$this->return_json('请输入活动标题');
|
|
}
|
|
if (!$bizIds) {
|
|
$this->return_json('请选择所属门店');
|
|
}
|
|
if (!$bgImg[0]['fileUrl']) {
|
|
$this->return_json('请选择背景图');
|
|
}
|
|
if (!$channelId) {
|
|
$this->return_json('请输入直播频道');
|
|
}
|
|
if (!$dateRange) {
|
|
$this->return_json('请选择直播时间');
|
|
}
|
|
if (!$introduction) {
|
|
$this->return_json('请输入活动简介');
|
|
}
|
|
$bgImg = $bgImg[0]['fileUrl'];
|
|
$channelImg = $channelImg[0]['fileUrl'] ? $channelImg[0]['fileUrl'] : '';
|
|
$shareTitle && $shareTitle = json_encode($shareTitle, JSON_UNESCAPED_UNICODE);
|
|
$setShareImg = '';
|
|
if ($shareImg) {
|
|
foreach ($shareImg as $v) {
|
|
$setShareImg[] = $v['fileUrl'];
|
|
}
|
|
$setShareImg = json_encode($setShareImg, JSON_UNESCAPED_UNICODE);
|
|
}
|
|
$addDate = ['title' => $title, 'bgImg' => $bgImg, 'channelImg' => $channelImg, 'channelId' => $channelId
|
|
, 'introduction' => $introduction, 'shareTitle' => $shareTitle, 'shareImg' => $setShareImg, 'timeStart' => $dateRange[0]
|
|
, 'timeEnd' => $dateRange[1], 'status' => 1, 'createTime' => date('Y-m-d H:i:s')];
|
|
$activityId = $this->mdSyliveActivity->add($addDate);
|
|
if (!$activityId) {
|
|
$this->return_json('添加活动失败');
|
|
}
|
|
$bizIds = implode(',', $bizIds);
|
|
$res_org = $this->mdSyliveOrganization->select(["organizationId in({$bizIds})" => null, 'organizationType' => 3]
|
|
, 'organizationId desc', 0, 0, 'organizationId,parentId');
|
|
$add_biz = [];
|
|
if ($res_org) {
|
|
$this->mdSyliveActivityBiz->update(['status' => -1], ["bizId not in({$bizIds})" => null, 'activityId' => $activityId, 'status' => 0]);
|
|
foreach ($res_org as $v) {
|
|
$add_biz[] = ['activityId' => $activityId, 'areaId' => $v['parentId']
|
|
, 'bizId' => $v['organizationId'], 'createTime' => date('Y-m-d H:i:s')];
|
|
}
|
|
//增加活动商家
|
|
$add_biz && $this->mdSyliveActivityBiz->add_batch($add_biz);
|
|
}
|
|
$this->return_response();
|
|
}
|
|
|
|
/**
|
|
* Notes:活动详情
|
|
* Created on: 2022/9/29 10:37
|
|
* Created by: dengbw
|
|
* @param null $activityId
|
|
*/
|
|
public function index_get($activityId = null)
|
|
{
|
|
if (!$activityId) {
|
|
$this->return_json('参数错误');
|
|
}
|
|
$re = $this->mdSyliveActivity->get(['activityId' => $activityId]);
|
|
if (!$re) {
|
|
$this->return_json('活动不存在');
|
|
}
|
|
$this->return_response($re);
|
|
}
|
|
|
|
/**
|
|
* Notes:修改活动
|
|
* Created on: 2022/9/21 14:48
|
|
* Created by: dengbw
|
|
*/
|
|
public function index_put()
|
|
{
|
|
$activityId = intval($this->input_param('activityId'));
|
|
$title = $this->input_param('title');
|
|
$channelId = $this->input_param('channelId');
|
|
$dateRange = $this->input_param('dateRange');
|
|
$introduction = $this->input_param('introduction');
|
|
$shareTitle = $this->input_param('shareTitle');
|
|
$shareImg = $this->input_param('shareImg');
|
|
$bgImg = $this->input_param('bgImg');
|
|
$channelImg = $this->input_param('channelImg');
|
|
$bizIds = $this->input_param('bizIds');
|
|
if (!$activityId) {
|
|
$this->return_json('参数错误');
|
|
}
|
|
if (!$title) {
|
|
$this->return_json('请输入活动标题');
|
|
}
|
|
if (!$bizIds) {
|
|
$this->return_json('请选择所属门店');
|
|
}
|
|
if (!$bgImg[0]['fileUrl']) {
|
|
$this->return_json('请选择背景图');
|
|
}
|
|
if (!$channelId) {
|
|
$this->return_json('请输入直播频道');
|
|
}
|
|
if (!$dateRange) {
|
|
$this->return_json('请选择直播时间');
|
|
}
|
|
if (!$introduction) {
|
|
$this->return_json('请输入活动简介');
|
|
}
|
|
$bizIds = implode(',', $bizIds);
|
|
$res_org = $this->mdSyliveOrganization->select(["organizationId in({$bizIds})" => null, 'organizationType' => 3]
|
|
, 'organizationId desc', 0, 0, 'organizationId,parentId');
|
|
$add_biz = [];
|
|
if ($res_org) {
|
|
$this->mdSyliveActivityBiz->update(['status' => -1], ["bizId not in({$bizIds})" => null, 'activityId' => $activityId, 'status' => 0]);
|
|
foreach ($res_org as $v) {
|
|
$re_org = $this->mdSyliveActivityBiz->get(['activityId' => $activityId, 'bizId' => $v['organizationId']]);
|
|
if (!$re_org) {
|
|
$add_biz[] = ['activityId' => $activityId, 'areaId' => $v['parentId']
|
|
, 'bizId' => $v['organizationId'], 'createTime' => date('Y-m-d H:i:s')];
|
|
} else if ($re_org['status'] == -1) {
|
|
$this->mdSyliveActivityBiz->update(['status' => 0], ['id' => $re_org['id']]);
|
|
}
|
|
}
|
|
//增加活动商家
|
|
$add_biz && $this->mdSyliveActivityBiz->add_batch($add_biz);
|
|
}
|
|
$bgImg = $bgImg[0]['fileUrl'];
|
|
$channelImg = $channelImg[0]['fileUrl'] ? $channelImg[0]['fileUrl'] : '';
|
|
$shareTitle && $shareTitle = json_encode($shareTitle, JSON_UNESCAPED_UNICODE);
|
|
$setShareImg = '';
|
|
if ($shareImg) {
|
|
foreach ($shareImg as $v) {
|
|
$setShareImg[] = $v['fileUrl'];
|
|
}
|
|
$setShareImg = json_encode($setShareImg, JSON_UNESCAPED_UNICODE);
|
|
}
|
|
$upDate = ['title' => $title, 'bgImg' => $bgImg, 'channelImg' => $channelImg, 'channelId' => $channelId, 'introduction' => $introduction,
|
|
'shareTitle' => $shareTitle, 'shareImg' => $setShareImg, 'timeStart' => $dateRange[0], 'timeEnd' => $dateRange[1]];
|
|
$this->mdSyliveActivity->update($upDate, ['activityId' => $activityId]);
|
|
$this->return_response();
|
|
}
|
|
|
|
/**
|
|
* Notes:修改商品
|
|
* Created on: 2022/9/28 15:09
|
|
* Created by: dengbw
|
|
*/
|
|
public function item_put()
|
|
{
|
|
$activityId = intval($this->input_param('activityId'));
|
|
$title = $this->input_param('title');
|
|
$price = $this->input_param('price');
|
|
$itemImg = $this->input_param('itemImg');
|
|
$dateRange = $this->input_param('dateRange');
|
|
$introduction = $this->input_param('introduction');
|
|
if (!$activityId) {
|
|
$this->return_json('参数错误');
|
|
}
|
|
$re = $this->mdSyliveActivity->get(['activityId' => $activityId]);
|
|
if (!$re) {
|
|
$this->return_json('活动不存在');
|
|
}
|
|
$jsondata = $re['jsondata'] ? json_decode($re['jsondata'], true) : [];
|
|
$item = ['title' => $title, 'price' => $price, 'timeStart' => $dateRange[0], 'timeEnd' => $dateRange[1], 'introduction' => $introduction];
|
|
if ($itemImg) {
|
|
$setItemImg = [];
|
|
foreach ($itemImg as $v) {
|
|
$setItemImg[] = $v['fileUrl'];
|
|
}
|
|
$item['itemImg'] = $setItemImg;
|
|
}
|
|
$jsondata['item'] = $item;
|
|
$upDate = ['jsondata' => json_encode($jsondata, JSON_UNESCAPED_UNICODE)];
|
|
$this->mdSyliveActivity->update($upDate, ['activityId' => $activityId]);
|
|
$this->return_response();
|
|
}
|
|
|
|
/**
|
|
* Notes:删除活动
|
|
* Created on: 2022/9/21 16:10
|
|
* Created by: dengbw
|
|
* @param null $activityId
|
|
*/
|
|
public function index_delete($activityId = null)
|
|
{
|
|
if (!$activityId) {
|
|
$this->return_json('参数错误');
|
|
}
|
|
$this->mdSyliveActivity->update(['status' => -1], ['activityId' => $activityId]);
|
|
$this->return_response();
|
|
}
|
|
|
|
/**
|
|
* Notes:批量删除用户
|
|
* Created on: 2022/9/8 17:11
|
|
* Created by: dengbw
|
|
*/
|
|
public function batch_delete()
|
|
{
|
|
$ids = $this->inputs;
|
|
if (!$ids) {
|
|
$this->return_json('参数错误');
|
|
}
|
|
$str_ids = implode(',', $ids);
|
|
if ($str_ids) {
|
|
$this->mdSyliveActivity->update(['status' => -1], ["activityId in($str_ids)" => null]);
|
|
}
|
|
$this->return_response();
|
|
}
|
|
|
|
/**
|
|
* Notes:修改状态
|
|
* Created on: 2022/9/8 16:10
|
|
* Created by: dengbw
|
|
*/
|
|
public function status_put()
|
|
{
|
|
$activityId = $this->input_param('activityId');
|
|
$status = $this->input_param('status');
|
|
if (!$activityId) {
|
|
$this->return_json('参数错误');
|
|
}
|
|
$this->mdSyliveActivity->update(['status' => $status], ['activityId' => $activityId]);
|
|
$this->return_response();
|
|
}
|
|
|
|
/**
|
|
* Notes:活动统计
|
|
* Created on: 2022/9/27 10:02
|
|
* Created by: dengbw
|
|
* @param null $activityId
|
|
*/
|
|
public function statistics_get($activityId = null)
|
|
{
|
|
$activityId = intval($activityId);
|
|
if (!$activityId) {
|
|
$this->return_json('参数错误');
|
|
}
|
|
$this->load->model('market/Market_sylive_activity_kpidata_model', 'mdSyliveActivityKpidata');
|
|
$this->load->model('market/Market_sylive_user_model', 'mdSyliveUser');
|
|
$this->load->model('live/Live_polyv_session_model', 'mdPolyvSession');
|
|
$title = '';
|
|
$activityData = $areaData = $bizData = $consultantData = $areaAry = [];
|
|
$re = $this->mdSyliveActivity->get(['activityId' => $activityId]);
|
|
if ($re) {
|
|
$title = $re['title'];
|
|
$res_biz = $this->mdSyliveActivityBiz->select(['activityId' => $activityId, 'status' => 0], 'browse desc');
|
|
foreach ($res_biz as $k => $v) {
|
|
$areaId = intval($v['areaId']);
|
|
$bizId = intval($v['bizId']);
|
|
$re_biz = $this->mdSyliveOrganization->get(['organizationId' => $bizId]);
|
|
if ($re_biz) {
|
|
$consultant = $this->mdSyliveActivityKpidata->count(['biz_id' => $bizId, 'a_id' => $activityId], 'distinct(cf_uid)');
|
|
$bizData[] = ['areaId' => $areaId, 'bizId' => $bizId,
|
|
'bizName' => $re_biz['organizationName'], 'consultant' => $consultant, 'browse' => $v['browse'], 'subscribe' => $v['subscribe']
|
|
, 'watch' => $v['watch'], 'order' => $v['orderTotal'], 'livePV' => 35, 'watchDuration' => 10];
|
|
if (!$areaAry[$areaId]) {//大区
|
|
$areaAry[$areaId] = 1;
|
|
} else {
|
|
$areaAry[$areaId] += 1;
|
|
}
|
|
}
|
|
}
|
|
foreach ($areaAry as $k => $v) {
|
|
$areaId = intval($k);
|
|
$re_area = $this->mdSyliveOrganization->get(['organizationId' => $areaId]);
|
|
if ($re_area) {
|
|
$consultant = $this->mdSyliveActivityKpidata->count(['area_id' => $areaId, 'a_id' => $activityId], 'distinct(cf_uid)');
|
|
$browse = $this->mdSyliveActivityKpidata->count(['area_id' => $areaId, 'a_id' => $activityId, 'kpi' => 'browse']);
|
|
$subscribe = $this->mdSyliveActivityKpidata->count(['area_id' => $areaId, 'a_id' => $activityId, 'kpi' => 'subscribe']);
|
|
$watch = $this->mdSyliveActivityKpidata->count(['area_id' => $areaId, 'a_id' => $activityId, 'kpi' => 'watch']);
|
|
$order = $this->mdSyliveActivityKpidata->count(['area_id' => $areaId, 'a_id' => $activityId, 'kpi' => 'order']);
|
|
$areaData[] = ['areaName' => $re_area['organizationName'], 'biz' => $v, 'consultant' => $consultant
|
|
, 'browse' => $browse, 'subscribe' => $subscribe, 'watch' => $watch, 'order' => $order
|
|
, 'livePV' => 35, 'watchDuration' => 10];
|
|
}
|
|
}
|
|
$res_user = $this->mdSyliveActivityKpidata->select(['a_id' => $activityId], 'id desc', 0, 0, 'distinct(cf_uid) as userId');
|
|
foreach ($res_user as $k => $v) {
|
|
$userId = intval($v['userId']);
|
|
$re_user = $this->mdSyliveUser->get(['userId' => $v['userId']]);
|
|
if ($re_user) {
|
|
$consultantName = $re_user['uname'] ? $re_user['uname'] : $re_user['nickname'];
|
|
$browse = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'cf_uid' => $userId, 'kpi' => 'browse']);
|
|
$subscribe = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'cf_uid' => $userId, 'kpi' => 'subscribe']);
|
|
$watch = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'cf_uid' => $userId, 'kpi' => 'watch']);
|
|
$order = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'cf_uid' => $userId, 'kpi' => 'order']);
|
|
$consultantData = [['consultantName' => $consultantName, 'browse' => $browse, 'subscribe' => $subscribe, 'watch' => $watch
|
|
, 'order' => $order, 'livePV' => 35, 'watchDuration' => 10]];
|
|
}
|
|
}
|
|
$browse = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'kpi' => 'browse']);
|
|
$subscribe = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'kpi' => 'subscribe']);
|
|
$watch = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'kpi' => 'watch']);
|
|
$order = $this->mdSyliveActivityKpidata->count(['a_id' => $activityId, 'kpi' => 'order']);
|
|
$activityData = [['name' => '参与区域数', 'value' => count($areaData)], ['name' => '参与门店数', 'value' => count($bizData)]
|
|
, ['name' => '参与顾问数', 'value' => count($res_user)], ['name' => '浏览人数', 'value' => $browse], ['name' => '预约人数', 'value' => $subscribe]
|
|
, ['name' => '观看人数', 'value' => $watch], ['name' => '订单数', 'value' => $order], ['name' => '直播时长', 'value' => 8]
|
|
, ['name' => '观看次数', 'value' => 10], ['name' => '人均观看', 'value' => 9]];
|
|
}
|
|
$data = ['activityId' => $activityId, 'title' => $title, 'activityData' => $activityData, 'areaData' => $areaData
|
|
, 'bizData' => $bizData, 'consultantData' => $consultantData];
|
|
$this->return_response($data);
|
|
}
|
|
|
|
/**
|
|
* Notes:活动订单列表
|
|
* Created on: 2022/9/29 9:53
|
|
* Created by: dengbw
|
|
* @param null $activityId
|
|
*/
|
|
public function order_get()
|
|
{
|
|
$this->load->model('market/Market_sylive_order_model', 'mdSyliveOrder');
|
|
$this->load->model('market/Market_sylive_user_model', 'mdSyliveUser');
|
|
$activityId = intval($this->input_param('activityId'));
|
|
$page = $this->input_param('page');
|
|
$limit = $this->input_param('limit');
|
|
$item_title = $this->input_param('item_title');
|
|
$mobile = $this->input_param('mobile');
|
|
$name = $this->input_param('name');
|
|
$status = $this->input_param('status');
|
|
$sid = $this->input_param('sid');
|
|
$sort = $this->input_param('sort');
|
|
$order = $this->input_param('order');
|
|
!$page && $page = 1;
|
|
!$limit && $limit = 10;
|
|
$sort_order = 'id desc';
|
|
if ($sort && $order) {
|
|
if ($sort == 'statusName') {
|
|
$sort_order = 'status ' . $order;
|
|
} else {
|
|
$sort_order = $sort . ' ' . $order;
|
|
}
|
|
}
|
|
$list = [];
|
|
if (!strlen($status)) {
|
|
$status = 1;
|
|
}
|
|
$where['status'] = $status;
|
|
$activityId && $where['item_id'] = $activityId;
|
|
$item_title && $where['item_title'] = $item_title;
|
|
$sid && $where['sid'] = $sid;
|
|
$str_user_ids = 0;
|
|
if ($name || $mobile) {
|
|
$where_user['status>='] = 0;
|
|
$name && $where_user["(uname LIKE '%{$name}%' OR mobile LIKE '%{$name}%')"] = null;
|
|
$mobile && $where_user['mobile'] = $mobile;
|
|
$res_user = $this->mdSyliveUser->select($where_user, 'userId desc', 0, 0, 'userId');
|
|
$res_user && $str_user_ids = implode(',', array_unique(array_column($res_user, 'userId')));
|
|
$where["u_id in($str_user_ids)"] = null;
|
|
}
|
|
$count = $this->mdSyliveOrder->count($where);
|
|
if ($count) {
|
|
$res = $this->mdSyliveOrder->select($where, $sort_order, $page, $limit);
|
|
$str_user_ids = implode(',', array_unique(array_column($res, 'uid')));
|
|
$map_users = $this->mdSyliveUser->map('userId', 'uname,nickname,mobile', ["userId in({$str_user_ids})" => null]);
|
|
foreach ($res as $v) {
|
|
$name = $map_users[$v['uid']]['uname'] ? $map_users[$v['uid']]['uname'] : $map_users[$v['uid']]['nickname'];
|
|
$mobile = $map_users[$v['uid']]['mobile'];
|
|
$list[] = [
|
|
'id' => $v['id'], 'sid' => $v['sid'], 'name' => $name, 'mobile' => $mobile, 'item_title' => $v['item_title']
|
|
, 'total_price' => $v['total_price'], 'pay_time' => $v['pay_time'] != '0000-00-00 00:00:00' ? $v['pay_time'] : ''
|
|
, 'statusName' => $this->mdSyliveOrder->statusAry($v['status']), 'createTime' => $v['createTime']];
|
|
}
|
|
}
|
|
$date = ['list' => $list, 'count' => $count];
|
|
$this->return_response_list($date);
|
|
}
|
|
|
|
} |