| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- <?php
- namespace app\admin\model;
- use think\Model;
- class Purchasesmstemplate extends Model
- {
- protected $table = 'purchase_sms_template';
- /** 时间由控制器写入 datetime 字符串(库表为 datetime,勿用 int 时间戳) */
- protected $autoWriteTimestamp = false;
- protected $createTime = false;
- protected $updateTime = false;
- protected $deleteTime = false;
- public function getSceneList()
- {
- return [
- 'review_email' => '协助下发-邮箱',
- 'review_sms' => '协助下发-短信',
- 'confirm_ok' => '采购确认-通过',
- 'confirm_fail' => '采购确认-未通过',
- 'bid_open' => '开标双重验证',
- ];
- }
- /** status:1=正常 0=禁用 */
- public function getStatusList()
- {
- return ['1' => '正常', '0' => '禁用'];
- }
- public static function isEmailScene(string $scene): bool
- {
- return $scene === 'review_email' || $scene === 'review';
- }
- public static function isSmsScene(string $scene): bool
- {
- return in_array($scene, ['review_sms', 'confirm_ok', 'confirm_fail', 'bid_open'], true);
- }
- /**
- * 各场景编辑弹窗右侧变量说明(统一列表,改 getVariableGuide() 一处即可)
- *
- * @return array<int, array{tag:string,label:string,example:string,scenes:string}>
- */
- public static function getVariableGuideForScene(string $scene): array
- {
- unset($scene);
- return static::getVariableGuide();
- }
- /**
- * 模版变量说明(唯一维护处:右侧「说明」列改这里 label 即可,四个模版弹窗显示相同)
- *
- * @return array<int, array{tag:string,label:string,example:string,scenes:string}>
- */
- public static function getVariableGuide(): array
- {
- return [
- ['tag' => '{company_name}', 'label' => '供应商名称', 'example' => '浙江某某印刷有限公司', 'scenes' => '全部'],
- ['tag' => '{contact_name}', 'label' => '姓名', 'example' => '张三', 'scenes' => '全部'],
- ['tag' => '{phone}', 'label' => '手机号', 'example' => '13800138000', 'scenes' => '全部'],
- ['tag' => '{email}', 'label' => '邮箱', 'example' => 'user@example.com', 'scenes' => '全部'],
- ['tag' => '{ccydh}', 'label' => '订单号', 'example' => '202603668L', 'scenes' => '全部'],
- ['tag' => '{cyjmc}', 'label' => '印件名称', 'example' => '藏书票2', 'scenes' => '全部'],
- ['tag' => '{cgymc}', 'label' => '工序名称(单道工序)', 'example' => '骑马订', 'scenes' => '协助下发'],
- ['tag' => '{category}', 'label' => '业务分类', 'example' => '出版物印刷', 'scenes' => '协助下发'],
- ['tag' => '{deadline}', 'label' => '截止时间', 'example' => '2026-05-18 14:30', 'scenes' => '协助下发'],
- ['tag' => '{process_lines}', 'label' => '订单工序明细(文本)', 'example' => "订单号:YW20240629001\n印件名称:藏书票2\n1.工序名称:做刀版 单位:张 本次数量:500", 'scenes' => '全部'],
- ['tag' => '{process_lines_html}', 'label' => '订单工序明细(表格)', 'example' => '<table>…</table>', 'scenes' => '协助下发邮箱'],
- ['tag' => '{platform_url}', 'label' => '平台链接', 'example' => 'https://…', 'scenes' => '协助下发邮箱'],
- ];
- }
- }
|