Aucune description

CustReportController.php 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. <?php
  2. /**
  3. * Created by Sublime.
  4. * User: hao
  5. * Date: 19/08/30
  6. * Time: 上午11:20
  7. */
  8. namespace App\Http\Controllers\Admin;
  9. use App\Http\Controllers\Controller;
  10. use App\Logs;
  11. use App\CustTotal;
  12. use App\CustDetail;
  13. use Illuminate\Http\Request;
  14. use Illuminate\Support\Facades\DB;
  15. class custReportController extends Controller
  16. {
  17. public function totalindex(Request $request){
  18. $page = (int)$request->input('page');
  19. $pageSize = 20;
  20. if($page<=0){
  21. $page = 1;
  22. }
  23. $offset = ($page-1) * $pageSize;
  24. $team_id = (int)$request->input('team_id');
  25. $stime = $request->input('stime');
  26. $etime = $request->input('etime');
  27. $count = CustTotal::where(function($query) use($team_id, $stime, $etime){
  28. if($team_id) $query->where('team_id', $team_id);
  29. if($stime) $query->where('dtime', '>=', $stime);
  30. if($etime) $query->where('dtime', '<=', $etime);
  31. })->where('is_del',0)->count();
  32. if ($count > 1) {
  33. // 总页数
  34. $pages = ceil($count/$pageSize);
  35. }else{
  36. // 总页数
  37. $pages = 1;
  38. }
  39. $result = CustTotal::where(function($query) use($team_id, $stime, $etime){
  40. if($team_id) $query->where('team_id', $team_id);
  41. if($stime) $query->where('dtime', '>=', $stime);
  42. if($etime) $query->where('dtime', '<=', $etime);
  43. })->where('is_del',0)->orderBy('id', 'desc')->offset($offset)->limit($pageSize)->get();
  44. $result = json_decode(json_encode($result),true);
  45. foreach($result as $k=>&$v){
  46. if($v['team_id']>0){
  47. $team = DB::table('teams')->select('name')->where('id', $v['team_id'])->first();
  48. $v['team_name'] = isset($team->name) ? $team->name : '';
  49. }else{
  50. $v['team_name'] = '';
  51. }
  52. }
  53. $teamList = DB::table('teams')->select('id', 'name')->get();
  54. $teamList = json_decode(json_encode($teamList), true);
  55. return view('custreport/totallist', ['result' =>$result,
  56. 'page' =>$page,
  57. 'count' =>$count,
  58. 'pages' =>$pages,
  59. 'teamlist' =>$teamList,
  60. 'stime' =>$stime,
  61. 'etime' =>$etime,
  62. 'team_id' =>$team_id,
  63. ]);
  64. }
  65. /**
  66. * 添加订单
  67. * @return \Illuminate\View\View
  68. */
  69. public function totalcreate(Request $request)
  70. {
  71. $teamList = DB::table('teams')->select('id', 'name')->get();
  72. $teamList = json_decode(json_encode($teamList), true);
  73. return view('custreport/totalcreate',['teamlist'=>$teamList]);
  74. }
  75. /**
  76. * 分组管理-进行添加操作
  77. * @param Request $request
  78. * @return \Illuminate\Http\RedirectResponse
  79. */
  80. public function totalstore(Request $request)
  81. {
  82. $team_id = (int)$request->input('team_id');
  83. $this->validate($request, [
  84. 'total_cost' => 'required',
  85. 'total_fan_add' => 'required',
  86. 'team_id' => 'required',
  87. 'dtime' => 'required|unique:cust_day_total,dtime,1,is_del,team_id,'.$team_id,
  88. ], [
  89. 'total_cost.required' => '总成本不能为空',
  90. 'total_fan_add.required' => '总加粉数不能为空',
  91. 'dtime.required' => '日期不能为空',
  92. 'team_id.required' => '团队不能为空',
  93. 'dtime.unique' => '指定日期已经添加过',
  94. ]);
  95. //数据库-新增数据
  96. $custreport = array();
  97. $custreport['total_cost'] = $request->input('total_cost');
  98. $custreport['total_fan_add'] = $request->input('total_fan_add');
  99. $custreport['dtime'] = $request->input('dtime');
  100. $custreport['team_id'] = $team_id;
  101. $res = DB::table('cust_day_total')->insert($custreport);
  102. return redirect('/admin/custreport/totalindex')->with('info', '添加成功');
  103. }
  104. /**
  105. * 分组管理-编辑分组界面
  106. * @param $id
  107. * @return \Illuminate\View\View
  108. */
  109. public function totaledit($id,Request $request)
  110. {
  111. $data = CustTotal::where('id', $id)->first();
  112. $teamList = DB::table('teams')->select('id', 'name')->get();
  113. $teamList = json_decode(json_encode($teamList), true);
  114. return view('custreport/totaledit', [
  115. 'custreport' => $data,
  116. 'teamlist' => $teamList,
  117. ]);
  118. }
  119. /**
  120. * 分组管理-进行编辑操作
  121. * @param Request $request
  122. * @return \Illuminate\Http\RedirectResponse
  123. */
  124. public function totalupdate(Request $request)
  125. {
  126. $team_id = (int)$request->input('team_id');
  127. $id = (int)$request->input('id');
  128. $this->validate($request, [
  129. 'id' => 'required',
  130. 'total_cost' => 'required',
  131. 'total_fan_add' => 'required',
  132. 'team_id' => 'required',
  133. 'dtime' => 'required|unique:cust_day_total,dtime,'.$id.',id,team_id,'.$team_id,
  134. ], [
  135. 'id.required' => 'id不能为空',
  136. 'total_cost.required' => '总成本不能为空',
  137. 'total_fan_add.required' => '总加粉数不能为空',
  138. 'team_id.required' => '团队不能为空',
  139. 'dtime.required' => '日期不能为空',
  140. 'dtime.unique' => '指定日期已存在',
  141. ]);
  142. $custreport = array();
  143. $custreport['total_cost'] = $request->input('total_cost');
  144. $custreport['total_fan_add'] = $request->input('total_fan_add');
  145. $custreport['dtime'] = $request->input('dtime');
  146. $custreport['team_id'] = $team_id;
  147. $res = DB::table('cust_day_total')->where('id', $id)->update($custreport);
  148. return redirect('/admin/custreport/totalindex')->with('info', '更新成功');
  149. }
  150. /**
  151. * 分组管理-进行删除操作
  152. * @param Request $request
  153. * @return \Illuminate\Http\RedirectResponse
  154. */
  155. public function totaldelete($id)
  156. {
  157. $custreport = CustTotal::find($id);
  158. $custreport->is_del = 1;
  159. if ($custreport ->save()){
  160. return redirect('/admin/custreport/totalindex')->with('info', '删除成功');
  161. }
  162. }
  163. public function total_export(Request $request){
  164. $self_role = session('role_name');
  165. if($self_role == '超级管理员' || $self_role == '团队主管'){
  166. $admin_id = $request->input('admin_id');
  167. }else{
  168. $admin_id = session('admin_id');
  169. }
  170. $stime = $request->input('stime');
  171. $etime = $request->input('etime');
  172. $result = custreport::where(function($query) use($admin_id, $stime, $etime){
  173. if($admin_id) $query->where('admin_id', $admin_id);
  174. if($stime) $query->where('createTime', '>=', $stime);
  175. if($etime) $query->where('createTime', '<=', $etime);
  176. })->where('is_del',0)->custreportBy('id', 'desc')->get();
  177. $result = json_decode(json_encode($result),true);
  178. $filename="订单数据.xls";
  179. header("Content-type:application/vnd.ms-excel");
  180. Header("Accept-Ranges:bytes");
  181. Header("Content-Disposition:attachment;filename=".$filename); //$filename导出的文件名
  182. header("Pragma: no-cache");
  183. header("Expires: 0");
  184. $data_str = '<html xmlns:o="urn:schemas-microsoft-com:office:office"
  185. xmlns:x="urn:schemas-microsoft-com:office:excel"
  186. xmlns="http://www.w3.org/TR/REC-html40">
  187. <head>
  188. <meta http-equiv="expires" content="Mon, 06 Jan 1999 00:00:01 GMT">
  189. <meta http-equiv=Content-Type content="text/html; charset=gb2312">
  190. <!--[if gte mso 9]><xml>
  191. <x:ExcelWorkbook>
  192. <x:ExcelWorksheets>
  193. <x:ExcelWorksheet>
  194. <x:Name></x:Name>
  195. <x:WorksheetOptions>
  196. <x:DisplayGridlines/>
  197. </x:WorksheetOptions>
  198. </x:ExcelWorksheet>
  199. </x:ExcelWorksheets>
  200. </x:ExcelWorkbook>
  201. </xml><![endif]-->
  202. </head>';
  203. $data_str .= "
  204. <table>
  205. <tr>
  206. <th>".iconv("UTF-8", "GB2312//IGNORE","销售微信号")."</th>
  207. <th>".iconv("UTF-8", "GB2312//IGNORE","销售团队")."</th>
  208. <th>".iconv("UTF-8", "GB2312//IGNORE","销售")."</th>
  209. <th>".iconv("UTF-8", "GB2312//IGNORE","订单时间")."</th>
  210. <th>".iconv("UTF-8", "GB2312//IGNORE","加粉时间")."</th>
  211. <th>".iconv("UTF-8", "GB2312//IGNORE","是否复购")."</th>
  212. <th>".iconv("UTF-8", "GB2312//IGNORE","订单金额")."</th>
  213. <th>".iconv("UTF-8", "GB2312//IGNORE","订单商品")."</th>
  214. <th>".iconv("UTF-8", "GB2312//IGNORE","是否退补单")."</th>
  215. <th>".iconv("UTF-8", "GB2312//IGNORE","配送地址")."</th>
  216. <th>".iconv("UTF-8", "GB2312//IGNORE","配送姓名")."</th>
  217. <th>".iconv("UTF-8", "GB2312//IGNORE","配送电话")."</th>
  218. <th>".iconv("UTF-8", "GB2312//IGNORE","供应商成本")."</th>
  219. <th>".iconv("UTF-8", "GB2312//IGNORE","顺丰单号")."</th>
  220. </tr>";
  221. foreach ($result as $k => $v)
  222. {
  223. #销售
  224. $admin = DB::table('admin')->where('id', $v['admin_id'])->first();
  225. $v['wx_id'] = isset($admin->wx_id) ? $admin->wx_id : '';
  226. #team
  227. $team = DB::table('teams')->where('id', $v['team_id'])->first();
  228. $v['team_name'] = isset($team->name) ? $team->name : '';
  229. #加粉时间
  230. $customr = DB::table('customers')->where('phone', $v['receiverMobile'])->first();
  231. $v['fanTime'] = isset($customr->fanTime) ? $customr->fanTime : '';
  232. $v['receiverMobile'] = substr($v['receiverMobile'], 0, 3).'****'.substr($v['receiverMobile'], 7);
  233. $fugou = $v['is_fugou']==1? '是' : '否';
  234. $is_refund = $v['is_refund']==1? '是' : '否';
  235. $address = $v['receiverState'].$v['receiverCity'].$v['receiverDistrict'].$v['receiverAddress'];
  236. $data_str .= "<tr>";
  237. $data_str .= "<td>".$v['wx_id']."</td>";
  238. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["team_name"])."</td>";
  239. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["admin_name"])."</td>";
  240. $data_str .= "<td>".$v['createTime']."</td>";
  241. $data_str .= "<td>".$v['fanTime']."</td>";
  242. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $fugou)."</td>";
  243. $data_str .= "<td>".$v['receivedAmount']."</td>";
  244. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["goods_note"])."</td>";
  245. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $is_refund)."</td>";
  246. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $address)."</td>";
  247. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["receiverName"])."</td>";
  248. $data_str .= "<td>".$v['receiverMobile']."</td>";
  249. $data_str .= "<td>".$v['cost']."</td>";
  250. $data_str .= "<td style='vnd.ms-excel.numberformat:@'>".$v["logistics_id"]."</td>";
  251. $data_str .= "</tr>";
  252. }
  253. $data_str .= "</table>";
  254. echo $data_str;
  255. exit;
  256. }
  257. public function detailindex(Request $request){
  258. $page = (int)$request->input('page');
  259. $pageSize = 20;
  260. if($page<=0){
  261. $page = 1;
  262. }
  263. $offset = ($page-1) * $pageSize;
  264. $self_role = session('role_name');
  265. if($self_role == '超级管理员' || $self_role == '团队主管' || $self_role == '运营投放'){
  266. $admin_id = $request->input('admin_id');
  267. $search_admin = 1;
  268. }else{
  269. $admin_id = session('admin_id');
  270. $search_admin = 0;
  271. }
  272. $stime = $request->input('stime');
  273. $etime = $request->input('etime');
  274. $count = CustDetail::where(function($query) use($admin_id, $stime, $etime){
  275. if($admin_id) $query->where('admin_id', $admin_id);
  276. if($stime) $query->where('dtime', '>=', $stime);
  277. if($etime) $query->where('dtime', '<=', $etime);
  278. })->where('is_del',0)->count();
  279. if ($count > 1) {
  280. // 总页数
  281. $pages = ceil($count/$pageSize);
  282. }else{
  283. // 总页数
  284. $pages = 1;
  285. }
  286. $result = CustDetail::where(function($query) use($admin_id, $stime, $etime){
  287. if($admin_id) $query->where('admin_id', $admin_id);
  288. if($stime) $query->where('dtime', '>=', $stime);
  289. if($etime) $query->where('dtime', '<=', $etime);
  290. })->where('is_del',0)->orderBy('id', 'desc')->offset($offset)->limit($pageSize)->get();
  291. $result = json_decode(json_encode($result),true);
  292. $adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
  293. $adminList = json_decode(json_encode($adminList), true);
  294. return view('custreport/detaillist', ['result' =>$result,
  295. 'page' =>$page,
  296. 'count' =>$count,
  297. 'pages' =>$pages,
  298. 'stime' =>$stime,
  299. 'etime' =>$etime,
  300. 'admin_id' =>$admin_id,
  301. 'search_admin' =>$search_admin,
  302. 'adminlist' =>$adminList,
  303. ]);
  304. }
  305. /**
  306. * 添加订单
  307. * @return \Illuminate\View\View
  308. */
  309. public function detailcreate(Request $request)
  310. {
  311. $adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
  312. $adminList = json_decode(json_encode($adminList), true);
  313. $teamList = DB::table('teams')->select('id', 'name')->get();
  314. $teamList = json_decode(json_encode($teamList), true);
  315. return view('custreport/detailcreate',['adminlist'=>$adminList, 'teamlist'=>$teamList]);
  316. }
  317. /**
  318. * 分组管理-进行添加操作
  319. * @param Request $request
  320. * @return \Illuminate\Http\RedirectResponse
  321. */
  322. public function detailstore(Request $request)
  323. {
  324. $admin_id = (int)$request->input('admin_id');
  325. if(!$admin_id){
  326. $admin_id = session('admin_id');
  327. }
  328. $this->validate($request, [
  329. 'old_consult' => 'required',
  330. 'new_consult' => 'required',
  331. 'fan_add' => 'required',
  332. 'dtime' => 'required|unique:cust_day_detail,dtime,1,is_del,admin_id,'.$admin_id,
  333. ], [
  334. 'old_consult.required' => '老粉咨询不能为空',
  335. 'new_consult.required' => '新粉咨询数不能为空',
  336. 'fan_add.required' => '加粉数不能为空',
  337. 'dtime.required' => '日期不能为空',
  338. 'dtime.unique' => '指定日期已经添加过',
  339. ]);
  340. //数据库-新增数据
  341. $custreport = array();
  342. $custreport['old_consult'] = $request->input('old_consult');
  343. $custreport['new_consult'] = $request->input('new_consult');
  344. $custreport['fan_add'] = $request->input('fan_add');
  345. $custreport['new_reply'] = $request->input('new_reply');
  346. $custreport['dtime'] = $request->input('dtime');
  347. if($admin_id>0){
  348. $admin_info = DB::table('admin')->select('realname', 'team_id')->where('id', $admin_id)->first();
  349. $custreport['admin_id'] = $admin_id;
  350. $custreport['admin_name'] = $admin_info->realname;
  351. }else{
  352. $custreport['admin_id'] = session('admin_id');
  353. $custreport['admin_name'] = session('real_name');
  354. }
  355. $custreport['reporter_id'] = session('admin_id');
  356. $res = DB::table('cust_day_detail')->insert($custreport);
  357. return redirect('/admin/custreport/detailindex')->with('info', '添加成功');
  358. }
  359. /**
  360. * 分组管理-编辑分组界面
  361. * @param $id
  362. * @return \Illuminate\View\View
  363. */
  364. public function detailedit($id,Request $request)
  365. {
  366. $data = CustDetail::where('id', $id)->first();
  367. $adminList = DB::table('admin')->select('id', 'realname', 'username')->where('id','>', 1)->get();
  368. $adminList = json_decode(json_encode($adminList), true);
  369. $teamList = DB::table('teams')->select('id', 'name')->get();
  370. $teamList = json_decode(json_encode($teamList), true);
  371. return view('custreport/detailedit', [
  372. 'custreport' => $data,
  373. 'adminlist' => $adminList,
  374. 'teamlist' => $teamList,
  375. ]);
  376. }
  377. /**
  378. * 分组管理-进行编辑操作
  379. * @param Request $request
  380. * @return \Illuminate\Http\RedirectResponse
  381. */
  382. public function detailupdate(Request $request)
  383. {
  384. $id = (int)$request->input('id');
  385. $admin_id = (int)$request->input('admin_id');
  386. if(!$admin_id){
  387. $admin_id = session('admin_id');
  388. }
  389. $this->validate($request, [
  390. 'id' => 'required',
  391. 'old_consult' => 'required',
  392. 'new_consult' => 'required',
  393. 'fan_add' => 'required',
  394. 'dtime' => 'required|unique:cust_day_detail,dtime,'.$id.',id,admin_id,'.$admin_id,
  395. ], [
  396. 'id.required' => 'id不能为空',
  397. 'old_consult.required' => '老粉咨询不能为空',
  398. 'new_consult.required' => '新粉咨询数不能为空',
  399. 'fan_add.required' => '加粉数不能为空',
  400. 'dtime.required' => '日期不能为空',
  401. 'dtime.unique' => '指定日期已经存在',
  402. ]);
  403. //数据库-新增数据
  404. $custreport = array();
  405. $custreport['old_consult'] = $request->input('old_consult');
  406. $custreport['new_consult'] = $request->input('new_consult');
  407. $custreport['fan_add'] = $request->input('fan_add');
  408. $custreport['new_reply'] = $request->input('new_reply');
  409. $custreport['dtime'] = $request->input('dtime');
  410. $admin_id = (int)$request->input('admin_id');
  411. if($admin_id>0){
  412. $admin_info = DB::table('admin')->select('realname', 'team_id')->where('id', $admin_id)->first();
  413. $custreport['admin_id'] = $admin_id;
  414. $custreport['admin_name'] = $admin_info->realname;
  415. }
  416. $res = DB::table('cust_day_detail')->where('id', $id)->update($custreport);
  417. return redirect('/admin/custreport/detailindex')->with('info', '更新成功');
  418. }
  419. /**
  420. * 分组管理-进行删除操作
  421. * @param Request $request
  422. * @return \Illuminate\Http\RedirectResponse
  423. */
  424. public function detaildelete($id)
  425. {
  426. $custreport = CustDetail::find($id);
  427. $custreport->is_del = 1;
  428. if ($custreport ->save()){
  429. return redirect('/admin/custreport/detailindex')->with('info', '删除成功');
  430. }
  431. }
  432. public function detail_export(Request $request){
  433. $self_role = session('role_name');
  434. if($self_role == '超级管理员' || $self_role == '团队主管' || $self_role == '运营投放'){
  435. $admin_id = $request->input('admin_id');
  436. }else{
  437. $admin_id = session('admin_id');
  438. }
  439. $stime = $request->input('stime');
  440. $etime = $request->input('etime');
  441. $result = CustDetail::where(function($query) use($admin_id, $stime, $etime){
  442. if($admin_id) $query->where('admin_id', $admin_id);
  443. if($stime) $query->where('createTime', '>=', $stime);
  444. if($etime) $query->where('createTime', '<=', $etime);
  445. })->where('is_del',0)->orderBy('id', 'desc')->get();
  446. $result = json_decode(json_encode($result),true);
  447. $filename="粉丝数据分日统计.xls";
  448. header("Content-type:application/vnd.ms-excel");
  449. Header("Accept-Ranges:bytes");
  450. Header("Content-Disposition:attachment;filename=".$filename); //$filename导出的文件名
  451. header("Pragma: no-cache");
  452. header("Expires: 0");
  453. $data_str = "
  454. <table>
  455. <tr>
  456. <th>".iconv("UTF-8", "GB2312//IGNORE","销售微信号")."</th>
  457. <th>".iconv("UTF-8", "GB2312//IGNORE","销售团队")."</th>
  458. <th>".iconv("UTF-8", "GB2312//IGNORE","销售")."</th>
  459. <th>".iconv("UTF-8", "GB2312//IGNORE","订单时间")."</th>
  460. <th>".iconv("UTF-8", "GB2312//IGNORE","加粉时间")."</th>
  461. <th>".iconv("UTF-8", "GB2312//IGNORE","是否复购")."</th>
  462. <th>".iconv("UTF-8", "GB2312//IGNORE","订单金额")."</th>
  463. <th>".iconv("UTF-8", "GB2312//IGNORE","订单商品")."</th>
  464. <th>".iconv("UTF-8", "GB2312//IGNORE","是否退补单")."</th>
  465. <th>".iconv("UTF-8", "GB2312//IGNORE","配送地址")."</th>
  466. <th>".iconv("UTF-8", "GB2312//IGNORE","配送姓名")."</th>
  467. <th>".iconv("UTF-8", "GB2312//IGNORE","配送电话")."</th>
  468. <th>".iconv("UTF-8", "GB2312//IGNORE","供应商成本")."</th>
  469. <th>".iconv("UTF-8", "GB2312//IGNORE","顺丰单号")."</th>
  470. </tr>";
  471. foreach ($result as $k => $v)
  472. {
  473. #销售
  474. $admin = DB::table('admin')->where('id', $v['admin_id'])->first();
  475. $v['wx_id'] = isset($admin->wx_id) ? $admin->wx_id : '';
  476. #team
  477. $team = DB::table('teams')->where('id', $v['team_id'])->first();
  478. $v['team_name'] = isset($team->name) ? $team->name : '';
  479. #加粉时间
  480. $customr = DB::table('customers')->where('phone', $v['receiverMobile'])->first();
  481. $v['fanTime'] = isset($customr->fanTime) ? $customr->fanTime : '';
  482. $v['receiverMobile'] = substr($v['receiverMobile'], 0, 3).'****'.substr($v['receiverMobile'], 7);
  483. $fugou = $v['is_fugou']==1? '是' : '否';
  484. $is_refund = $v['is_refund']==1? '是' : '否';
  485. $address = $v['receiverState'].$v['receiverCity'].$v['receiverDistrict'].$v['receiverAddress'];
  486. $data_str .= "<tr>";
  487. $data_str .= "<td>".$v['wx_id']."</td>";
  488. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["team_name"])."</td>";
  489. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["admin_name"])."</td>";
  490. $data_str .= "<td>".$v['createTime']."</td>";
  491. $data_str .= "<td>".$v['fanTime']."</td>";
  492. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $fugou)."</td>";
  493. $data_str .= "<td>".$v['receivedAmount']."</td>";
  494. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["goods_note"])."</td>";
  495. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $is_refund)."</td>";
  496. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $address)."</td>";
  497. $data_str .= "<td>".iconv("UTF-8", "GB2312//IGNORE", $v["receiverName"])."</td>";
  498. $data_str .= "<td>".$v['receiverMobile']."</td>";
  499. $data_str .= "<td>".$v['cost']."</td>";
  500. $data_str .= "<td style='vnd.ms-excel.numberformat:@'>".$v["logistics_id"]."</td>";
  501. $data_str .= "</tr>";
  502. }
  503. $data_str .= "</table>";
  504. echo $data_str;
  505. exit;
  506. }
  507. }