LjhController.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace pt\controllers;
  3. use bizHd\ljh\classes\LjhApplyClass;
  4. use common\components\dict;
  5. use common\components\miniUtil;
  6. use bizHd\wx\classes\WxOpenClass;
  7. use Yii;
  8. class LjhController extends BaseController
  9. {
  10. public $guestAccess = ['list', 'mini-code'];
  11. //申请列表
  12. public function actionList()
  13. {
  14. ini_set('memory_limit', '2045M');
  15. set_time_limit(0);
  16. $list = LjhApplyClass::getAllByCondition(['status' => 2], 'payTime DESC', '*');
  17. if (empty($list)) {
  18. echo '暂无报名';
  19. }
  20. $apiHost = Yii::$app->params['hdImgHost'];
  21. echo "<div style='text-align:center;'>";
  22. echo "<table style='border:1px solid #CCCCCC;margin:0 auto;'>";
  23. echo "<tr><th>编号</th><th>订单号</th><th>花店名称</th><th>姓名</th><th>手机号</th><th>头像</th><th>报名费</th><th>支付时间</th><th>地址</th></tr>";
  24. foreach ($list as $key => $custom) {
  25. $shopName = $custom['name'] ?? '';
  26. $adminName = $custom['adminName'] ?? '';
  27. $mobile = $custom['mobile'] ?? '';
  28. $cover = $custom['cover'] ?? '';
  29. $actPrice = $custom['actPrice'] ?? 0;
  30. $address = $custom['address'] ?? '';
  31. $url = $apiHost . $cover;
  32. $no = bcadd($key, 1);
  33. $payTime = $custom['payTime'] ?? '';
  34. $orderSn = $custom['orderSn'] ?? '';
  35. $time = date("m-d H:i", strtotime($payTime));
  36. echo "<tr><td>{$no}</td><td>{$orderSn}</td>";
  37. echo "<td>{$shopName}</td><td>{$adminName}</td><td>{$mobile}</td>";
  38. echo "<td><img src='{$url}' style='width:100px;height:auto;' /></td><td>¥{$actPrice}</td><td>{$time}</td>";
  39. echo "<td>{$address}</td>";
  40. echo "</tr>";
  41. }
  42. echo "</table>";
  43. echo "</div>";
  44. echo '<style>td,th{border:1px solid #CCCCCC;}</style>';
  45. }
  46. //小程序码 ssh 20230305
  47. public function actionMiniCode()
  48. {
  49. $merchant = WxOpenClass::getWxInfo();
  50. $page = 'admin/ljh/info';
  51. $ptStyle = dict::getDict('ptStyle', 'hd');
  52. $scene = "";
  53. $imgUrl = miniUtil::generateUnlimitedMiniCode($merchant, $page, $scene, $ptStyle);
  54. $apiHost = Yii::$app->params['hdImgHost'];
  55. $url = $apiHost . $imgUrl;
  56. echo "<img src='" . $url . "' />";
  57. }
  58. }